<< Back to API Docs

Making HTTP Requests

Every Request considers the following important parameters at least:

HTTP Request Path ending

The last characters of the HTTP Request Path, preceded by a dot (.), determine the response format. E.g, if there were a resource at http://foo.bar/hello, it could be retrieved as XML from http://foo.bar/hello.xml.

Valid values (one MUST be provided):

json
The Result will be formated as JSON. This is the default if a value is not given.
js
The body of the Response will be a piece of JavaScript code calling a function specified by the HTTP Request argument callback value, using the actual Result of the request (as a JavaScript object, formated the same as the JSON representation would) as the first and only parameter in this call. This is only useful if you are using the API from JavaScript (JSONP).
xml
The Result will be formated as XML.

If the representation you ask for is not supported, then the server responds with HTTP Status Code 406 and an error Result representation.

HTTP Request Header Accept-Charset

Behaves as defined in RFC 2616, sec 14.2 except Quality Factors (q) are ignored.

If nothing is specified, then UTF-8 is assumed.

If the charset you ask for is not supported or can't encode the Result, then the server responds with HTTP Status Code 406 and an error Result representation.

HTTP Request Header Content-Type

Behaves as defined in RFC 2616, sec 14.17. The mime type specified must be application/x-www-form-urlencoded (this is usually the default for HTTP clients).

You can specify the value of the argument charset in this header to change the charset of the HTTP Request contents, otherwise charset=UTF-8 will be assumed.

HTTP Parameter input_language
This value determines the language of any text Meaningtool will try to read from the input text. If you don't specify this, Meaningtool will try to guess the language.