Comments (21)
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.)
from iodocs.
Damn that "Comment & Close" button. :)
from iodocs.
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 -
{ httpMethod: 'POST',
oauth: '',
methodUri: '/posts.json',
params: { post: { 'title]': 'foo', 'body]': 'bar' } },
apiKey: '',
apiSecret: 'undefined',
apiName: 'SomeAPI' }
Unsecured Call
{ headers: { 'Content-Length': 0 },
protocol: 'http',
host: 'example.com',
method: 'POST',
path: '/posts.json?post=' }
- It tries to send the params in the url
- The format of the param names are not correct. Both title and body ends with a closing square bracket.
from iodocs.
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.
from iodocs.
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?
from iodocs.
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.
from iodocs.
has this been committed into the master ? looks like not.
from iodocs.
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?
from iodocs.
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
from iodocs.
Thanks for the update Martin.
- Mike Peterson
-----Original Message-----
From: Martin Tajur
[mailto:[email protected]]
Sent: Thursday, June 28, 2012 5:26 AM
To: Allblues
Subject: Re: [iodocs] HTTP POST/PUT params (#3)
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
Reply to this email directly or view it on GitHub:
#3 (comment)
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2180 / Virus Database: 2437/5104 - Release Date: 07/01/12
from iodocs.
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.
Is there a way to indicate which parameter goes in the body and which one goes in the query url?
from iodocs.
Interesting. I may take a look to see if a new option makes sense per parameter.
from iodocs.
Can someone confirm if there is any way to put parameters in POST body.
@ccervon : Did you find any solution?
from iodocs.
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:
{"_id":"51256ef66b1acdb6e5000002","email":"[email protected]"}
from iodocs.
Adding parameters in POST body works fine.
from iodocs.
@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
from iodocs.
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.
from iodocs.
@vkorapaty, @dgc-wh
beautiful work.
from iodocs.
@vkorapaty, @dgc-wh
ditto.
from iodocs.
@vkorapaty
I tried pulling out the latest iodocs from https://github.com/mashery/iodocs but the POST with request body does not seem to be working. I pulled out the latest from your branch too but nothing is working. Could you help?
from iodocs.
Closed by commit 8ff62fc
from iodocs.
Related Issues (20)
- No info displayed about parameters in the endpoints
- iodocs hangs on starting a request with a path parameter containing spaces
- Format updater HOT 2
- Exception in file read HOT 9
- How to generate I/O Docs clients automatically?
- parameter type json HOT 2
- File in Response Body
- JSON example on readme.md is invalid
- Schema Documentation HOT 1
- Performance Issues
- Long integer content-parameters issue HOT 1
- iodocs npm start don't run on mac HOT 3
- include external json schema
- Object inside Array Doesn't have a field name
- Information required on iodocs
- Show response body on all requests
- Using a parameter named 'length'
- demo link 404
- Adapt Authoring Tool Issue
- schema for OpenAPI 2.0 IN JSON format
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iodocs.