rest - Localizing reason phrase in status line of the RESTful HTTP API reponse -
we have restful api exposed on http in natural way makes use of http status-line (status-code , reason-phrase) communicate api result client (http://www.w3.org/protocols/rfc2616/rfc2616-sec6.html).
for example have following status line concurrency error:
http/1.1 409 resource updated different user. reload , try again.
it turned out messages presented end users of application built against our api meaning need localize them. i'm wondering if accepted approach in such scenarios, considering non-ascii charset of messages, or should reason phrase (status description) kept low level message , content make its' way user screen should passed in response body? there can bite later on if choose localize reason-phrase part?
in case use response body pass new version of resource api client , including additional data doesn't see play nicely that.
as you'll know rfc:
the status-code intended use automata , reason-phrase intended human user
so it's worth trying find balance between short , to-the-point while still being user-friendly. many webservices i've seen have status node (xml or json) containing code , more human-friendly message part of response data.
one potential issue: in 1 of our restful apis, customised reason phrase aid debugging. monitoring uptime pingdom, incorrectly accepted service being available if status matched suggested in rfc - (ie 200 ok
). having pointed out them incorrect, referred rfc(!), although conceded had misinterpreted it.
Comments
Post a Comment