java - Best practice regarding REST services and I18N -


i have client app communicates server using rest services. client app multilingual means server must aware of user's locale during calls. want use "post location" approach has nice , restful feel it. when data gets posted actions resource uri is:

/actions/{language} 

the language important can localize error messages (or returning data) get. when server responds needs send uri of resource. if send back

/actions/{id} 

where id id of newly created resource, isn't entirely correct

/actions/{language}/{id} 

would uri of localized resource. actual resource without language context.

any opinions on best practice scenario?

i'm not convinced language should part of "address", thing identifies resource, unless part of identity, , tension have between

 /actions/{id} 

and

 /actions/{lang}/{id} 

shows not right.

one alternative approach use http header locale information pass language. pass language query parameter, modifier of request.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -