Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content-Type header #13

Open
germank opened this issue Nov 23, 2011 · 0 comments
Open

Content-Type header #13

germank opened this issue Nov 23, 2011 · 0 comments

Comments

@germank
Copy link

germank commented Nov 23, 2011

The Content-Type header isn't propagated when POSTing data. Instead, it's replaced by a form-data type. This is particular issue is problematic when dealing with RESTful services that consumes a particular content-type (application/json, application/xml).
I solved this by adding this line just before the curl_exec:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: '.$_SERVER['CONTENT_TYPE']));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant