We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given this api http://api.lbs.yandex.net/geolocation
I need to post JSON body (example)
json={ "common": { "version": "1.0", "api_key": "AAwkGkwBAAAA9muWLAMAKp9XjTBZtmOLeiBQJqHX6YEqNdUAAAAAAAAAAAAoEP1ZsBlcVFA_OpP55MK3Ek1r8A==" }, "gsm_cells": [ { "countrycode": 250, "operatorid": 99, "cellid": 42332, "lac": 36002, "signal_strength": -80, "age": 5555 } ], "wifi_networks": [ { "mac": "00-1C-F0-E4-BB-F5", "signal_strength": -88, "age": 0, } , { "mac": "00904CC10000", "signal_strength": -87, "age": 0, } ], "ip": { "address_v4": "178.247.233.32" } }
I can do this in advanced Rest client, but when I try airborne
require 'airborne' require 'json' Airborne.configure do |config| config.base_url = 'http://api.lbs.yandex.net' config.headers = {'Content-Type' => 'application/json'}, {'accept' => 'application/json'} end
describe 'geolocation' do
it 'geolocation' do json = 'json = { "common": { "version": "1.0", "api_key": "AAwkGkwBAAAA9muWLAMAKp9XjTBZtmOLeiBQJqHX6YEqNdUAAAAAAAAAAAAoEP1ZsBlcVFA_OpP55MK3Ek1r8A==" }, "gsm_cells": [ { "countrycode": 250, "operatorid": 99, "cellid": 42332, "lac": 36002, "signal_strength": -80, "age": 5555 } ], "wifi_networks": [ { "mac": "00-1C-F0-E4-BB-F5", "signal_strength": -88, "age": 0, } , { "mac": "00904CC10000", "signal_strength": -87, "age": 0, } ], "ip": { "address_v4": "178.247.233.32" } }' post '/geolocation', {'Content-Type' => 'application/json'}, {'accept' => 'application/json'}, json.to_json
end
I always get
ArgumentError: wrong number of arguments (4 for 1..3)
What did I do wrong? How to post json using airborne?
The text was updated successfully, but these errors were encountered:
You are passing too many arguments. You have two arguments for headers, merge them.
Sorry, something went wrong.
No branches or pull requests
Given this api http://api.lbs.yandex.net/geolocation
I need to post JSON body (example)
json={
"common": {
"version": "1.0",
"api_key": "AAwkGkwBAAAA9muWLAMAKp9XjTBZtmOLeiBQJqHX6YEqNdUAAAAAAAAAAAAoEP1ZsBlcVFA_OpP55MK3Ek1r8A=="
},
"gsm_cells": [
{
"countrycode": 250,
"operatorid": 99,
"cellid": 42332,
"lac": 36002,
"signal_strength": -80,
"age": 5555
}
],
"wifi_networks": [
{
"mac": "00-1C-F0-E4-BB-F5",
"signal_strength": -88,
"age": 0,
}
,
{
"mac": "00904CC10000",
"signal_strength": -87,
"age": 0,
}
],
"ip": {
"address_v4": "178.247.233.32"
}
}
I can do this in advanced Rest client, but when I try airborne
require 'airborne'
require 'json'
Airborne.configure do |config|
config.base_url = 'http://api.lbs.yandex.net'
config.headers = {'Content-Type' => 'application/json'}, {'accept' => 'application/json'}
end
describe 'geolocation' do
it 'geolocation' do
json = 'json = {
"common": {
"version": "1.0",
"api_key": "AAwkGkwBAAAA9muWLAMAKp9XjTBZtmOLeiBQJqHX6YEqNdUAAAAAAAAAAAAoEP1ZsBlcVFA_OpP55MK3Ek1r8A=="
},
"gsm_cells": [
{
"countrycode": 250,
"operatorid": 99,
"cellid": 42332,
"lac": 36002,
"signal_strength": -80,
"age": 5555
}
],
"wifi_networks": [
{
"mac": "00-1C-F0-E4-BB-F5",
"signal_strength": -88,
"age": 0,
}
,
{
"mac": "00904CC10000",
"signal_strength": -87,
"age": 0,
}
],
"ip": {
"address_v4": "178.247.233.32"
}
}'
post '/geolocation', {'Content-Type' => 'application/json'}, {'accept' => 'application/json'}, json.to_json
end
end
I always get
ArgumentError:
wrong number of arguments (4 for 1..3)
What did I do wrong? How to post json using airborne?
The text was updated successfully, but these errors were encountered: