Ruby

Ruby code posted by Luka
created at 15 Oct 11:44, updated at 18 Mar 15:32

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
# Your Gemfile
gem "rest-client"

# Console or Model
resource = RestClient::Resource.new(
    "localhost:3000/api/v1/distance_and_bearing",
    payload: {
    api_key: YOUR_API_KEY,
    payload: {origin: ORIGIN_AIRPORT_ID, destination: DESTINATION_AIRPORT_ID}
    }
    )
    
response = resource.get
312 Bytes in 2 ms with coderay