本文整理匯總了PHP中Httpful\Request::options方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::options方法的具體用法?PHP Request::options怎麽用?PHP Request::options使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Httpful\Request
的用法示例。
在下文中一共展示了Request::options方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processAction
public function processAction(CRM_Civirules_TriggerData_TriggerData $triggerData)
{
//do the http post process
$uri = $this->getFullUri($triggerData);
$method = $this->getHttpMethod();
$body = http_build_query($this->getBodyParams($triggerData));
switch (strtolower($method)) {
case 'post':
$request = \Httpful\Request::post($uri, $body);
break;
case 'put':
$request = \Httpful\Request::put($uri, $body);
break;
case 'delete':
$request = \Httpful\Request::delete($uri);
break;
case 'head':
$request = \Httpful\Request::head($uri);
break;
case 'patch':
$request = \Httpful\Request::patch($uri, $body);
break;
case 'options':
$request = \Httpful\Request::options($uri, $body);
break;
case 'get':
$request = $response = \Httpful\Request::get($uri);
break;
default:
throw new Exception('Invalid HTTP Method');
}
$request->neverSerializePayload();
$request = $this->alterHttpRequestObject($request, $triggerData);
$response = $request->send();
$this->handleResponse($response, $request, $triggerData);
}