Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Return application/json content-type instead of text/html #6

Closed
brannondorsey opened this issue Apr 9, 2019 · 0 comments · Fixed by #45
Closed

Return application/json content-type instead of text/html #6

brannondorsey opened this issue Apr 9, 2019 · 0 comments · Fixed by #45
Labels
bug Something isn't working

Comments

@brannondorsey
Copy link
Member

All HTTP endpoints associated with the model-sdk return their responses using content-type: text/html instead of application/json, even though most of the results (except some 500 errors) return JSON. All endpoints should return JSON, even on 500 error, and the Content-type: application/json should be sent as the response type.

curl -v -H "content-type: application/json" -d '{"pixel_order": "rgb"}' http://localhost:8000/setup
*   Trying ::1...
* TCP_NODELAY set
* Connection failed
* connect to ::1 port 8000 failed: Connection refused
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8000 (#0)
> POST /setup HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.54.0
> Accept: */*
> content-type: application/json
> Content-Length: 22
>
* upload completely sent off: 22 out of 22 bytes
< HTTP/1.1 200 OK
< Content-Type: text/html; charset=utf-8
< Content-Length: 17
< Access-Control-Allow-Origin: *
< Date: Tue, 09 Apr 2019 14:20:13 GMT
<
* Connection #0 to host localhost left intact
{"success": true}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant