Active
Project:
cURL HTTP Request
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
28 Apr 2013 at 15:23 UTC
Updated:
11 Jul 2014 at 12:32 UTC
Jump to comment: Most recent
Comments
Comment #1
minoroffense commentedSomething like this.
http://erisds.co.uk/code/twitter-oauth-simple-curl-requests-for-your-own...
Comment #2
A.Kotov commentedPlease, give example of use chr_curl_http_request()
does it work the same as drupal_http_request($url, array $options = array()) ?
$url: A string containing a fully qualified URI.
array $options: (optional) An array that can have one or more of the following elements:
headers: An array containing request headers to send as name/value pairs.
method: A string containing the request method. Defaults to 'GET'.
data: A string containing the request body, formatted as 'param=value¶m=value&...'. Defaults to NULL.
max_redirects: An integer representing how many times a redirect may be followed. Defaults to 3.
timeout: A float representing the maximum number of seconds the function call may take. The default is 30 seconds. If a timeout occurs, the error code is set to the HTTP_REQUEST_TIMEOUT constant.
context: A context resource created with stream_context_create().
Return value
object An object that can have one or more of the following components:
request: A string containing the request body that was sent.
code: An integer containing the response status code, or the error code if an error occurred.
protocol: The response protocol (e.g. HTTP/1.1 or HTTP/1.0).
status_message: The status message from the response, if a response was received.
redirect_code: If redirected, an integer containing the initial response status code.
redirect_url: If redirected, a string containing the URL of the redirect target.
error: If an error occurred, the error message. Otherwise not set.
headers: An array containing the response headers as name/value pairs. HTTP header names are case-insensitive (RFC 2616, section 4.2), so for easy access the array keys are returned in lower case.
data: A string containing the response body that was received.
Comment #3
minoroffense commentedYup. That's all in the function docs.
http://cgit.drupalcode.org/chr/tree/chr.module#n72