adsabs / adsws

ADS web services
Other
2 stars 15 forks source link

API/microservice Content-Type #83

Closed jonnybazookatone closed 8 years ago

jonnybazookatone commented 8 years ago

Does the API overrides user defined content-types in certain cases? For example:

curl -v "http://localhost/query2svg/<ID>"
< HTTP/1.0 200 OK
< Content-Type: image/svg+html
< Content-Length: 741
< Server: Werkzeug/0.11.2 Python/2.7.6
< Date: Mon, 16 Nov 2015 19:59:42 GMT
< 

as expected: https://github.com/adsabs/myads/blob/master/myads_service/views/query_as_monument.py#L33

But via the API:

curl -v "http://localhost/v1/vault/query2svg/<ID>"
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Content-Type: text/html; charset=utf-8
< Content-Length: 741
...
...
< Server: Werkzeug/0.10.4 Python/2.7.6
< Date: Mon, 16 Nov 2015 20:23:18 GMT
< 

This returns the correct Content-Type when is a single service, but when a part of the API it is returned as 'text/html'.

romanchyla commented 8 years ago

and also the 502 and 500 return text/html

i think we should always stick to application/json UNLESS the microservice specified a different return header

jonnybazookatone commented 8 years ago

Related to #89.

jonnybazookatone commented 8 years ago

v1.0.1