actionhero doesn't do any limiting/checking of the content type of a request, but follows pretty normal form parsing logic via the
formidable package. With GET, using a content type of `text/xml` works just as well as `something/crazy`. IE: These both work with the example
cacheTest action:
Now with POST requests (where you specify params as form variables, and not part of the URL/query string), the content type must match form data. If you want to send form data, the Content-Type must be something like `application/x-www-form-urlencoded` and not `text/xml`. For example, this works:
while this doesn't:
Following this, if you want to post a JSON body payload, you have to be sure that the Content-Type matches. The following is a valid JSON way to send the same information (note the Content-Type change):
You can pass options to formidable via `api.config.servers.web.formOptions` in `config/servers/web.js`. If you want to limit your API to only accept certain ContentTypes, you can inspect a connection's type with `connection.rawConnection.req.headers`. You can create a middleware to reject all requests without a certain heder if you would like.