runwayml / model-sdk

💥🐍 Runway Model SDK: port your own machine learning models to Runway

Home Page:https://sdk.runwayml.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

brannondorsey opened this issue · comments

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}