In the case of limited support for POST in the HTTP client software where pure data cannot be submitted in the HTTP message body, RESTfm is able to handle data encoded in either application/x-www-form-urlencoded or multipart/form-data formats.
Note: The application/x-www-form-urlencoded and multipart/form-data formats are only applicable to the HTTP POST method (and not GET, PUT or DELETE).
Note 2: Only the application/x-www-form-urlencoded format is described here. This format uses the same 'URL encoding' scheme as required for GET query string parameters as described here.
- Support for larger data size than what is possible using a GET query string.
- Will not work for field names that begin with 'RFM', as these are reserved words for RESTfm query string parameters.
Note: There is work-around where another format (e.g. JSON) may be embedded into a single RFMdata field. See section on embedding other formats below.
Embedding other formats
RESTfm allows data in a different format (say XML, JSON, or your custom format) to be embedded into a single RFMdata field inside of an application/x-www-form-urlencoded or multipart/form-data message.
- No clashing of name space for field names that begin with 'RFM'.
- Support for bulk operations where multiple records may be included in the one HTTP transaction.
- Additional encoding requirements.
Specify format of embedded data.
|RFMdata=<encoded data>||Embedded data of specified format. Must be "URL encoded" in addition to specified format.|
Original JSON message to create two new records:
The above JSON message is then URL encoded and embedded into a x-www-form-urlencoded POST message as the RFMdata parameter.
Note: Both the RFMformat and RFMdata parameters are required
Response when message is POSTed: