rest - (Ab?)using http custom headers to return metadata about an entity -


if, in addition binary image data, want return data structure in same http response message. data structure describe image further receiving application use information process image if wanted to, way it?

when transmitting data structure without image data, i'd return json.

  1. like other image, image/... content-type, adding custom http response headers containing data
  2. using application/json (or xml or ...) containing json data structure , field containing encoded binary image data
  3. as metadata in image binary itself, although specific type of image used (png different gif etc.)

1) easiest me implement both server-side , client-side, wonder, if that's not abusing http headers, otoh. maybe similar of standard http headers etags.

2) , 3) aren't easy use both client- , server-side, , 2) not efficient (cpu, bandwidth) 1) , 3).

the nice thing 1) , 3) clients unaware of metadata (js client?) @ least display image.

any objections 1) http police? other option missed?

4) content-type = multipart/mixed. if you're using browser, see here.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -