-
Notifications
You must be signed in to change notification settings - Fork 415
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
HTTP POST/PUT params #3
Comments
In your use case, is your param list that you're POSTing in the request body live inside of a container? (e.g. JSON, JSON-RPC, etc.) |
Damn that "Comment & Close" button. :) |
The API (is a rails app) I was trying to use requires the following json as the request body - {
"post":{
"title":"foo",
"body":"bar"
}
} I tried to setup the parameters as - "parameters":[
{
"Name":"post[title]",
"Required":"Y",
"Default":"",
"Type":"string",
"Description":"Title"
},
{
"Name":"post[body]",
"Required":"Y",
"Default":"",
"Type":"string",
"Description":"Body"
}
] and this is what I have noticed in the debug output -
|
I get a similar issue when I try to access calls using the API tester for POST functions. PHP (well at least my version of 5.3) doesn't populate the global $_POST array with the parameters passed in the URL even though the HTTP method is POST. I have to resort to using $_GET or $_REQUEST arrays to make it work with the API tester. Perhaps if params were sent in the request body as abasak requests, this issue would be fixed as well. |
I'd love to see this as well. I'm trying to setup a PUT method with our API and we require the updated fields to be in a JSON object in the request body (not as parameters in the URL). Any update on this? |
I ran into the same issue, plus some others involving port numbers, https and API keys ... all when not using OAuth. Fixed in ezarko@35b3994. Pull request sent. |
has this been committed into the master ? looks like not. |
Is there a resolution to this issue? Can someone provide an example of how to include a param list in JSON in the request body of a POST? |
I've just recently worked on this and thought about sharing the work I did. I've created a pull request with a patch that would use the HTTP request body instead of GET parameters when the request method is either POST, PUT or DELETE. The pull request is here: #33 |
Thanks for the update Martin.
-----Original Message----- I've just recently worked on this and thought about sharing the work I did. I've created a pull request with a patch that would use the HTTP request The pull request is here: #33 Reply to this email directly or view it on GitHub: No virus found in this message. |
I just started using iodocs and so far I'm loving it. The only issue I have is that I have a few POST methods that require body parameters AND they can be used with a few query parameters as well. |
Interesting. I may take a look to see if a new option makes sense per parameter. |
Can someone confirm if there is any way to put parameters in POST body. |
This seems to be working now, tested PUTs only. Example config: {
"MethodName":"Update user",
"Synopsis":"Updates user with data supplied in request body",
"HTTPMethod":"PUT",
"URI":"/users/",
"RequiresOAuth":"N",
"parameters":[
{
"Name":"_id",
"Required":"Y",
"Default":"",
"Type":"string",
"Description":"user id"
},
{
"Name":"email",
"Required":"N",
"Default":"",
"Type":"string",
"Description":"email address"
}
]
} Sends request BODY as: |
Adding parameters in POST body works fine. |
@ccervon, Can you proved the Json of a post using body you are confirming? {
"MethodName": "addfacebookconnection",
"Synopsis": "Add a Facebook Connect to the Current Customer Session",
"HTTPMethod": "POST",
"URI": "/visitor/addfacebookconnection",
"RequiresOAuth": "N",
"parameters": [
{
"Name":"Payload",
"Required":"Y",
"Default":"",
"Type":"string",
"Description":"user id"
}
]
}
Does not work |
You can check out the fork that I've been working on with @dgc-wh, https://github.com/vkorapaty/iodocs (check the 'example' branch, or can check out the live example here: http://iodocs.vky.me/whitehat). PUT and POST methods can have a request body in addition to query parameters. I believe Issue #66 is also working on this. |
@vkorapaty, @dgc-wh beautiful work. |
@vkorapaty, @dgc-wh |
@vkorapaty |
Closed by commit 8ff62fc |
Is there any way parameters can be passed in the request body rather than the url for POST/PUT methods? Currently all params are sent via the url, even for POST/PUT.
The text was updated successfully, but these errors were encountered: