When using format=json on the api, the wrong mediatype is returned.
This causes a problem when using different frameworks in java since automatic decoding is not supported.
For example the following code snippet will return an exception:
Will send a request url: https://<hostname>/ws.php?format=json&method=pwg.images.getInfo&image_id=339
And result in an exception:
org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/plain;charset=utf-8, type=class <package>.PiwigoResponse, genericType=class <package>.PiwigoResponse.
When using format=json on the api, the wrong mediatype is returned.
This causes a problem when using different frameworks in java since automatic decoding is not supported.
For example the following code snippet will return an exception:
```
ClientConfig clientConfig = new ClientConfig().register(GsonMessageBodyHandler.class);
Client client = ClientBuilder.newClient(clientConfig);
Response response = client.target("https://<hostname>")
.path(String.format("ws.php"))
.queryParam(FORMAT_JSON.getKey(), FORMAT_JSON.getValue())
.queryParam(IMAGE_INFO.getKey(), IMAGE_INFO.getValue())
.queryParam(IMAGE_ID, imageId)
.request(MediaType.APPLICATION_JSON).get();
return response.readEntity(PiwigoResponse.class);
```
Will send a request url: `https://<hostname>/ws.php?format=json&method=pwg.images.getInfo&image_id=339`
And result in an exception:
```
org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/plain;charset=utf-8, type=class <package>.PiwigoResponse, genericType=class <package>.PiwigoResponse.
```
<!-- github-sync-id:1524142030 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
When using format=json on the api, the wrong mediatype is returned.
This causes a problem when using different frameworks in java since automatic decoding is not supported.
For example the following code snippet will return an exception:
Will send a request url:
https://<hostname>/ws.php?format=json&method=pwg.images.getInfo&image_id=339And result in an exception: