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

Add support for raw POST like curl's --data option #64

Open
birtles opened this issue Sep 13, 2016 · 7 comments
Open

Add support for raw POST like curl's --data option #64

birtles opened this issue Sep 13, 2016 · 7 comments

Comments

@birtles
Copy link

birtles commented Sep 13, 2016

Specifically, I was trying to use this with W3C's Echidna publication system but ran it to trouble since it complained that it doesn't support form data.

@mirkoperillo
Copy link
Contributor

Curl documentation says that

-d, --data <data>
              (HTTP) Sends the specified data in a POST request  to  the  HTTP
              server,  in  the  same  way  that a browser does when a user has
              filled in an HTML form and presses the submit button. This  will
              cause curl to pass the data to the server using the content-type
              application/x-www-form-urlencoded.

So doing a POST with Form body and MIME type application/x-www-form-urlencoded should work

@birtles
Copy link
Author

birtles commented Sep 13, 2016

Yes, I read that too and expected the same. Unfortunately in practice it is not the same. curl --data works but form with application/x-www-form-urlencoded in REST easy does not.

@mirkoperillo
Copy link
Contributor

Do you have error or warning in javascript console or some message / http code error in response ?

This can be useful to understand where is the issue

@birtles
Copy link
Author

birtles commented Sep 15, 2016

Sorry for the delay, you can reproduce simply by doing a POST to https://labs.w3.org/echidna/api/request
The result returned is:

{"status":"Form Content-Type not supported"}

I get a 501 Not Implemented return code with the following headers:

Name Value
X-Powered-By Express
Content-Type application/json; charset=utf-8
Content-Length 44
Etag W/"2c-De5+vJK+2lj7uobm3ktF6w"
Vary Accept-Encoding
Date Thu, 15 Sep 2016 05:29:28 GMT
Strict-Transport-Security max-age=15552015; preload
Public-Key-Pins pin-sha256=.....

@mirkoperillo
Copy link
Contributor

I tried using the master branch version and it seems to work.

I tried a POST request with Form body, application/x-www-form-urlencoded MIME, given fake url, decision and token params and the service returns 202 http code and a Uuid

@mirkoperillo
Copy link
Contributor

This issue is silent for a month, maybe it can be closed.

If @birtles has news about he can always reopen it

@birtles
Copy link
Author

birtles commented Oct 28, 2016

Thanks. Sorry, I haven't had time to try install a trunk version to test but I trust it works!

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

2 participants