Yii Framework Forum: Hackerone Curl Extension Curl Options? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Hackerone Curl Extension Curl Options? what is the syntax for setOption(s)? Rate Topic: -----

#1 User is offline   augurone 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 24-January 13

Posted 24 January 2013 - 08:30 PM

Referencing this extension
http://www.yiiframew...nsion/yii-curl/

I need to submit a cURL request and only take the HTTP_CODE as the response.

I am seeing curl_getinfo($c, CURLINFO_HTTP_CODE) out there, and this works at the command line curl -sO -w "%{http_code}" URL, but it is a bit unclear how to set the option in the wrapper provided by hackerone.

$output = Yii::app()->curl->setOption($name, $value)->get($url);

This suggests that $name and $value (A A-V pair) are PHP variables?

Thanks in advance for responses.
0

#2 User is offline   AustinGeek 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 173
  • Joined: 22-September 12

Posted 29 January 2013 - 06:41 PM

View Postaugurone, on 24 January 2013 - 08:30 PM, said:

Referencing this extension
http://www.yiiframew...nsion/yii-curl/

I need to submit a cURL request and only take the HTTP_CODE as the response.

I am seeing curl_getinfo($c, CURLINFO_HTTP_CODE) out there, and this works at the command line curl -sO -w "%{http_code}" URL, but it is a bit unclear how to set the option in the wrapper provided by hackerone.

$output = Yii::app()->curl->setOption($name, $value)->get($url);

This suggests that $name and $value (A A-V pair) are PHP variables?

Thanks in advance for responses.



Not sure exactly but I have had some success with this... I had to set the HTTP HEADER (curl -H "Authorization:23942340324"....


$auth = array('Authorization:'.$token);
$jsonObject = Yii::app()->curl->setOption(CURLOPT_HTTPHEADER, $auth)->get($url);


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users