How To Use Content Types

OINO.cloud APIs support the standard HTTP headers for specifying content types, Content-Type for the POST/PUT request body and Accept for GET response data. For example if you just add a form to your HTML page it will correctly set Content-Type as application/x-www-form-urlencoded and Accept as text/html to get the API response as HTML. These headers can be overridden by the oinorequesttype and oinoresponsetype query parameters in the request URL for example if you want data in specific format.

Content Types

The following content types are supported:

  • application/json: JSON serialized data. Default format if content type is not defined
  • text/csv: Comma separated, double quoted values with double-doublequotes in the data. Two consequtive commas will be treated as an undefined value (e.g. property not defined in JSON) and an unescaped null as an SQL null-value.
  • application/x-www-form-urlencoded: URL-encoded form data. Null-values are not supported.
  • multipart/form-data: Multipart form data especially for sending base64 encoded binary data. Mixed multipart files not supported and will skipped.
  • text/html (response only): Convert response data to HTML using templates.
Example