Service Response

From The spring:// Network Documentation
Jump to: navigation, search

Previous | Up | Next

When there is data as a result of a Network Service request, the response content is specified by service followed by a forward slash and a data type. Currently text and multi are the only supported types but binary will be implemented in the future.


The service/text response indicates that the content is text. The formatting of the text is arbitrary and is handled as appropriate by the requesting service.


service/text [Content]


200 69 service/text {"post":{"title":"Example title","tags":["foo","bar"]}}


The response service/multi acts as a header for a stream of responses in a format agnostic way. The size of the response is the equivalent of the header. The header is followed by the actual responses with a response code 201 which indicates a chunk of a stream and finally the stream is terminated by a 202 code which indicates end of transfer. Nesting service/multi responses creates a stack.


service/multi [Content] 202


200 14 service/multi 69 201 service/text {"post":{"title":"Example title","tags":["foo","bar"]}} 201 69 service/text {"post":{"title":"Example title","tags":["foo","bar"]}} 202

Previous | Up | Next