return Content Type of application/hal+json instead of just json

304 views
Skip to first unread message

orta therox

unread,
Sep 13, 2015, 3:01:38 PM9/13/15
to Artsy API Developers
See: http://stateless.co/hal_specification.html

How to serve HAL

HAL has a media type for both the JSON and XML variants, whos names are application/hal+json and application/hal+xml respectively.
When serving HAL over HTTP, the Content-Type of the response should contain the relevant media type name.


We're currently returning application/json. This opens us to be able to use more hypermedia clients! :D 

orta therox

unread,
Sep 13, 2015, 3:18:29 PM9/13/15
to Artsy API Developers
Related: I've also had a report that we're handing our accept responses incorrect:

$ curl -H 'Accept: application/hal+json' https://api.artsy.net/api -I
HTTP/1.1 200 OKAY
Content-Type: application/json
```

$ curl -H 'Accept: applicatiomn/vnd.siren+json; application/hal+json' https://api.artsy.net/api -I
HTTP/1.1 400 Bad Request

Daniel Doubrovkine

unread,
Sep 14, 2015, 10:03:32 AM9/14/15
to orta therox, Artsy API Developers
I think you should open those as bugs in Gravity (our internal API project).

[A.]    Daniel Doubrovkine (dB.)
         CTO @ Artsy   

         d...@artsy.net

         @dblockdotorg

         code.dblock.org



--
Find all info about the Artsy.net API at https://developers.artsy.net.
---
You received this message because you are subscribed to the Google Groups "Artsy API Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to artsy-api-develo...@googlegroups.com.
To post to this group, send email to artsy-api-...@googlegroups.com.
Visit this group at http://groups.google.com/group/artsy-api-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/artsy-api-developers/891c5a0f-2cf5-4b61-a77e-cd9218dd3dba%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages