Am I breaking any laws in the REST Bible by returning an application / octet stream for my answers? The REST endpoint receives 5 image URLs.
{ "image1": "http://ww.o.com/1.gif", "image2": "http://www.foo.be/2.gif" }
and it will load them and return them as an application / octet stream.
CLARIFICATION . The client that invokes this REST interface is a mobile application. All additional network connections reduce battery life by a few milliamps. I have to use REST because it is the standard of the company. If not, I will make my own binary protocol.
, , , - - ( , , ).
multipart . IMO, , image/gif, .
image/gif
, RPC. , " URL-, ".
RESTful, REST RPC.
, , .
, :
POST /archives Content-Type: application/json { "image1": "http://ww.o.com/1.gif", "image2": "http://www.foo.be/2.gif" }
HTTP/1.1 201 Created Location: http://example.com/archives/1234 Content-Type: application/json
http://example.com:
GET /archives/1234 Accept: multipart/mixed
( ), . (multipart/x-zip , zip )
:
GET /archives/1234 Accept: application/json
JSON, ( , , , -, , , ).
PUT /archives/1234 Content-Type: application/json { "image1": "http://ww.o.com/1.gif", "image2": "http://www.foo.be/2.gif", "image3": "http://www.foo2.foo/4.gif" }
//1234, .
: JSON . , Accept. - , , .
,
DELETE /archives/1234
.
REST?
. , 2 .
REST, , , IMO. REST - , URL- ( ) . , . , REST .
, @Andrey , , adhoc-. Multipart mimeType/format - , - , tar, zip .
. "application/octet-stream" , , . , "", , . - () , , , , .
Source: https://habr.com/ru/post/1720527/More articles:What is the best size for toolbar icons? - user-interfaceWordpress-only membership plugin - wordpressWhat is the life cycle of loading an ASP.NET file to code? - c #My mistake with the strpos function? PHP - phpHow to filter files that can be seen in the download window? - javascriptWPF and 3D how to change one position in 3D space? - c #Can't access custom profile properties from web.config? - c #Migrating from Silverlight 2 to 3 - silverlight-3.0Debugging a static library using Eclipse CDT - cwhy is it that when loading the file Application_BeginRequest does not start on the published site? - asp.net-mvcAll Articles