cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: PHP CURL Custom HTTP Request Problem

From: Dung Nguyen <chong.xipam_at_gmail.com>
Date: Tue, 4 May 2010 12:46:14 +0700

problem here is the GET is call like this
GET /transfer? HTTP/1.1
server refuse to accept. I do like this in my application
GET /transfer?rnd=0.12345 HTTP/1.1
and it working. Just don't known how to do it in php + curl :(
I found there are *CURLOPT_CUSTOMREQUEST *option in curl but it only change
the request command, not the parameter :((

2010/5/4 Dung Nguyen <chong.xipam_at_gmail.com>

> OKEY, here is my code
> $cookies="RKJGRLGJRGLEJFLEJFELFJELGE";
> $ch = curl_init('https://myurl.com/transfer?rnd=0.11454636353435435";
> curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
> curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
>
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_HEADER, 1);
> curl_setopt ($ch, CURLOPT_COOKIE, "JSESSIONID=".$cookies);
> $result2=curl_exec($ch);
>
> curl_close ($ch);
>
>
> 2010/5/4 Linus Nielsen Feltzing <linus_at_haxx.se>
>
> Dung Nguyen skrev:
>>
>>> Hello all!
>>> I'm trying do a request use CURL. This request is a GET request. I want
>>> to do like this
>>>
>>> GET /config?x=0.12345 HTTP/1.1
>>> Content-Type: application/x-www-form-urlencoded
>>> Cookie: JSESSIONID=9JHDF83VJ390FJ30FJ4V04J9V04J4
>>> Host: example.com <http://example.com>
>>>
>>> Accept: text/html, */*
>>> User-Agent: Mozilla/3.0
>>>
>>> however i can't make it work for CURL, it always transfer my request to
>>> GET /config? HTTP/1.1
>>> and this cause my request faild :(
>>>
>>> Is there any way to solve my problem ?
>>>
>>
>> I'm sure there is, but we can't help you if you don't show us your PHP
>> code.
>>
>> Linus
>>
>> -------------------------------------------------------------------
>> List admin: http://cool.haxx.se/list/listinfo/curl-library
>> Etiquette: http://curl.haxx.se/mail/etiquette.html
>>
>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-04