...
array key | array content value | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code | The current HTTP Status code returned from the request (See https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) This response status code can be used to detect, for example 404 not found errors, or similar, of a page. By means, you may throw optional exceptions by checking this code state as you need. | ||||||||||||||
header | The full response header returned from the request as ...
... where info is an array with keys and values. Example:
| ||||||||||||||
body | The full returned body of the request | ||||||||||||||
parsed | If the body are recognized as specially formatted (json, xml, etc), the parsed array will transform into an object or an array, depending on the content. Currently, the parser supports simpler modes like XML (SimpleXMLElement) and by this also RSS-feeds (unconfirmed), JSON and serialized data. The curl library also supports usage of the PEAR-package XML_Serializer. |
Posting parameters
As of the release of 20161213 (which can be found in the repo), all functions that allows postData to be sent in a web call may be posted quite freely. You can either put postData in the standard format like:
...
Code Block | ||
---|---|---|
| ||
doPost("http://test.com/", $postDataObject, \TorneLIB\CURL_POST_AS::POST_AS_JSON) // Alternative without the POST_AS-constant // doPost("http://test.com/", $postDataObject, 1) |
The function itself tries to detect if the input $postDataObject is encoded or decoded (keep in mind that problems with NAN-values or similar is not supported).
...
$Response = $CURL->doGet("https://test.com/requestService?wsdl", \TorneLIB\CURL_POST_AS::POST_AS_SOAP);
Alternative, without the POST_AS-constant:
$Response = $CURL->doGet("https://test.com/requestService?wsdl", 2);
SSL Certificates and verification
...