rest - Is it acceptable to pass json string in the http header to provide options to the server when doing PATCH request? -



rest - Is it acceptable to pass json string in the http header to provide options to the server when doing PATCH request? -

in restful service, want allow users update fields of resource patch requests. however, there's requirement when updating fields have perform actions on back-end depending on provided options. don't want mix options primary info in body of request, came 2 possible solutions.

pass options via query string pass options via http header json string.

since, in cases options can contain relatively big text, decided pass options via http header.

has done before? there possible issues can face later? practice @ all? if not, how else can accomplish same?

i'd depends on how much of rest purist want be.

i'd prefer pass options body, because patch method has defined semantics, no defined info format, so, there's nil preventing sending options in patch body, since have document payload format anyway.

if that's not alternative you, i'd passing options via query string to the lowest degree desirable one, since uris atomic, including query string, , you're changing identifier.

using custom http header more acceptable, must document how header supposed work. minor issue header length undefined http protocol, limit @ to the lowest degree few kb implementations, not real problem.

json rest http

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -