tmhUtilities::auto_fix_time_request
Make an HTTP request using this library. This method is different to 'request' because on a 401 error it will retry the request.
When a 401 error is returned it is possible the timestamp of the client is too different to that of the API server. In this situation it is recommended the request is retried with the OAuth timestamp set to the same as the API server. This method will automatically try that technique. This method doesn't return anything. Instead the response should be inspected directly.
Signature
public function auto_fix_time_request(
$tmhOAuth,
string
$method,
string
$url,
[array
$params = ,
[boolean
$useauth = true,
[boolean
$multipart = false]]] )
Parameters
$tmhOAuth
—$method
— string- the HTTP method being used. e.g. POST, GET, HEAD etc
$url
— string- the request URL without query string parameters
$params
— array- the request parameters as an array of key=value pairs
$useauth
— boolean- whether to use authentication when making the request. Default true.
$multipart
— boolean- whether this request contains multipart data. Default false
Line | Task |
---|---|
212 | this check is horrid but helps avoid requesting twice when the username and password are wrong |