SQL Guides

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 an HTML form posts its data with Content-Type application/x-www-form-urlencoded, which the API reads directly. For responses, the first supported content type listed in the Accept header is used, so a browser navigating to an API url gets HTML. If none of the listed types is supported (e.g. */*, the HTMX default) the response is JSON, so set it explicitly when needed, e.g. hx-headers='{"Accept": "text/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