|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46176 Making POST requests do not always return correct Mime Type
Submitted: 2008-09-25 23:09 UTC Modified: 2008-09-29 00:28 UTC
From: dhendric at adobe dot com Assigned:
Status: Not a bug Package: cURL related
PHP Version: 5.2.6 OS: Mac OS X Leopard
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dhendric at adobe dot com
New email:
PHP Version: OS:


 [2008-09-25 23:09 UTC] dhendric at adobe dot com
When using the curl class or the HTTP Request class (Pear) that sends a POST request, some instances return the wrong mime type in the header data. Using linux commands POST and wget return correct mime type in header for the same request.

curl via Mac OS X command line:

deirdra-hendrickss-macbook-pro:~ dhendric$ curl --url "" -d "fmt=png&req=catalogprops,text" -i
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Last-Modified: Thu, 25 Sep 2008 23:05:41 GMT
ETag: "6d16a6640f1e7e88731e9688556b6596"
Content-Type: text/plain
Content-Length: 466
Expires: Thu, 25 Sep 2008 23:05:43 GMT
Date: Thu, 25 Sep 2008 23:05:43 GMT
Connection: keep-alive

Reproduce code:
$URL = ",text";
        $c = curl_init();
        curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($c, CURLOPT_POST, true);
        curl_setopt($c, CURLOPT_URL, $URL);
		echo curl_getinfo($c, CURLINFO_CONTENT_TYPE);

Expected result:
should echo "text/plain"

Actual result:
echos "image/jpeg"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-29 00:28 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

According to strace, the server returns Content-Type: image/jpeg as you 
can see from the trace below. cURL simply returns the data it received 
from the server.

recvfrom(3, "HTTP/1.1 200 OK\r\nServer: Apache-Coyote/1.1\r\nLast-
Modified: Mon, 29 Sep 2008 00:27:17 GMT\r\nETag: 
image/jpeg\r\nContent-Length: 271\r\nExpires: Mon, 29 Sep 2008 10:27:17 
GMT\r\nDate: Mon, 29 Sep 2008 00:27:18 GMT\r\nConnection: keep-
\27\24\26\26\32\35%\37\32\33#\34\26\26 , #&\')*)\31\37-0-
(0%()(\1\7\7\7\n\10\n\23\n\n\23(\32\26\32(((((((((((((("..., 16384, 0, 
NULL, NULL) = 553

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Aug 09 11:01:24 2020 UTC