Skip to content

Content-Type header #13

Description

@germank

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']));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions