Comments (5)
BTW: It is already a couple of days ago. I reviewed my sources and found this solution (which works as well):
post 'token',
"username=#{CGI::escape(user[:username])}&password=#{CGI::escape(user[:password])}&grant_type=password&client_id=#{CGI::escape(CLIENT_ID)}",
{:content_type => 'application/x-www-form-urlencoded', :accept => 'application/json'}
I think my question was more about "how to transport forms parameters in the body" (which is what my example shows)
from airborne.
Hi Neil,
I figured out how to Post with parameters using a 'params' header. See below:
post_body = nil
post '/my_url', post_body, {'params' => {my_param1: 123, my_param2: 'abc'}}
I've discovered this by looking at the source code for RestClient. Specifically line 213 of request.rb
Maybe we should update the airborne Readme with a params example.
from airborne.
Ah, thanks for letting me know.
Regards
from airborne.
No Problem! @brooklynDev I've added a pull request for the Readme.
from airborne.
@Rodney-QAGeek Thanks, looks good! I've merged it in.
from airborne.
Related Issues (20)
- GET from test environment HOT 1
- How to set verify_ssl => false HOT 4
- Faraday Response support HOT 1
- Potential incompatibility with RSpec 3.5.4 HOT 7
- Routing error with post action
- Ruby 2.4 warnings HOT 2
- Is there a way to test for the absence of data? HOT 9
- ARRAY: Api request returned invalid json (Airborne::InvalidJsonError) HOT 6
- Argument error when making POST requests HOT 2
- Looking for Project Maintainers HOT 13
- : (
- Bug: expect_json_sizes with * don't work as expected
- JSON array body instead of hash body in POST/PUT
- Why header keys are downcased? HOT 1
- Is it possible to use on a non-request spec?
- is it possible to use 'Content_Type' => 'application/xml'
- Rails 5.1.5 compatibilty HOT 1
- Is this project dead? HOT 17
- PUT request with no request_body and error messaging issue HOT 1
- Not working with rails HOT 1
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 airborne.