Re: Reading binary http post

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

on 02/23/2006 02:55 PM Dirk Vanden Boer said the following:
>> The problem is that you are misleading PHP telling that you are posting
>> form data. You need to correct the request Content-Type. It must not be
>> application/x-www-form-urlencoded nor multipart/form-data . I think you
>> can use anything except those types, like for instance
>> application/octet-stream which is the default for binary files.
>>
>> I don't know how can you hack libcurl to make it use the right request
>> content-type. It is probably easy. If you are not able to do it, you may
>> want to try this PHP HTTP client class . It can send custom POST
>> requests.
>>
>> http://www.phpclasses.org/httpclient
>>
> 
> You are correct, setting the headers is necessary but I was already
> doing that, curl supports it by calling
> 
> struct curl_slist *headers=NULL;
> headers = curl_slist_append(headers, "Content-Type: text/xml");
> curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, headers);

Maybe you think you are doing that correctly but in fact that may not be
accurate.

If you are sure that the content type of the request being sent is
text/xml and PHP is treating as a form post, you should report that as a
PHP bug because PHP should only process form requests when the content
type specifies that.

For binary posts, the way to retrive posted data is not via $_POST.
There are other request variables for that.

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux