Skip to content

HttpRequestTask doesn't support POST application/json #715

Closed
@mreiche

Description

As mentioned here #228 and here https://github.com/phingofficial/phing/blob/master/CHANGELOG.md#aug-21-2013---phing-260

Phing HttpRequestTask should be able to POST application/json

<http-request
	url="localhost/deploy.php"
	verbose="true"
	method="POST">
	<config name="adapter" value="HTTP_Request2_Adapter_Curl"/>
	<config name="ssl_verify_host" value="false"/>
	<header name="content-type" value="application/json" />
	<postparameter name="param1" value="test1" />
	<postparameter name="param2" value="test2" />
</http-request>

But

echo 'body: ' . file_get_contents('php://input');

is empty.

It supports POST as urlencoded parameters when removing "Content-Type"

body: param1=test1¶m2=test2

I'm using Phing 2.13.0

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions