REST-Easy
REST-Easy copied to clipboard
Add support for raw POST like curl's --data option
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.
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
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.
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
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=..... |
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
This issue is silent for a month, maybe it can be closed.
If @birtles has news about he can always reopen it
Thanks. Sorry, I haven't had time to try install a trunk version to test but I trust it works!