googleapis / googleapis/google-http-java-client

HttpResponseException.getContent() should return an InputStream

Abierto
#491 2 comentarios 0 reacciones 0 asignados Ver en GitHub
type: feature request
Lenguaje dominante
Java
Estrellas
1.4k
Forks
473
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

#### Environment details

- OS: Win 10
- Java version: 8 u144
- google-http-java-client version: 1.25.0

#### Steps to reproduce

1. Create a request for the URL: `https://maps.googleapis.com/maps/api/staticmap?markers=-30.93963400,-61.56805900&size=672x297`
2. It will throw a `HttpResponseException` since the page returns a `403 Forbidden`

The problem here is that `HttpResponseException.getContent()` returns a `String` (implemented for #143). However, the response for that URL is an image (`content-type: image/png`).

I think that `HttpResponseException.getContent()` should be equal to `HttpResponse.getContent()`. It is currently being parsed at [HttpResponseException.java#L175](https://github.com/googleapis/google-http-java-client/blob/master/google-http-client/src/main/java/com/google/api/client/http/HttpResponseException.java#L175).

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.