FlightInfo v2

API change history

arrivals

Try it

Request

Request URL

Request parameters

  • string
  • string

    Format - date-time (as date-time in RFC3339).

Request headers

  • string
  • string
    Subscription key which provides access to this API. Found in your Profile.

Request body

Responses

200 OK

OK

Representations

{
  "to": {
    "arrivalAirportIata": "string",
    "arrivalAirportIcao": "string",
    "arrivalAirportSwedish": "string",
    "arrivalAirportEnglish": "string",
    "flightArrivalDate": "string"
  },
  "numberOfFlights": 0,
  "flights": [
    {
      "flightId": "string",
      "departureAirportSwedish": "string",
      "departureAirportEnglish": "string",
      "airlineOperator": {
        "iata": "string",
        "icao": "string",
        "name": "string"
      },
      "arrivalTime": {
        "scheduledUtc": "string",
        "estimatedUtc": "string",
        "actualUtc": "string"
      },
      "locationAndStatus": {
        "terminal": "string",
        "gate": "string",
        "flightLegStatus": "SCH",
        "flightLegStatusSwedish": "string",
        "flightLegStatusEnglish": "string"
      },
      "baggage": {
        "estimatedFirstBagUtc": "string",
        "baggageClaimUnit": "string",
        "firstBagUtc": "string",
        "lastBagUtc": "string"
      },
      "codeShareData": [
        "string"
      ],
      "flightLegIdentifier": {
        "ifplId": "string",
        "callsign": "string",
        "aircraftRegistration": "string",
        "ssrCode": "string",
        "flightId": "string",
        "flightDepartureDateUtc": "string",
        "departureAirportIata": "string",
        "arrivalAirportIata": "string",
        "departureAirportIcao": "string",
        "arrivalAirportIcao": "string"
      },
      "remarksEnglish": [
        {
          "text": "string",
          "indicator": "string"
        }
      ],
      "remarksSwedish": [
        {
          "text": "string",
          "indicator": "string"
        }
      ],
      "viaDestinations": [
        {
          "airportIATA": "string",
          "airportSwedish": "string",
          "airportEnglish": "string"
        }
      ],
      "diIndicator": "string"
    }
  ]
}
{
  "type": "object",
  "properties": {
    "to": {
      "type": "object",
      "properties": {
        "arrivalAirportIata": {
          "description": "Iata code for arrival airport",
          "type": "string"
        },
        "arrivalAirportIcao": {
          "description": "Icao code for arrival airport",
          "type": "string"
        },
        "arrivalAirportSwedish": {
          "description": "Arrival airport name in Swedish",
          "type": "string"
        },
        "arrivalAirportEnglish": {
          "description": "Arrival airport name in English",
          "type": "string"
        },
        "flightArrivalDate": {
          "description": "Arrival date in UTC",
          "type": "string"
        }
      },
      "description": "Arriving to"
    },
    "numberOfFlights": {
      "format": "int32",
      "description": "Number of flights in response",
      "type": "integer"
    },
    "flights": {
      "description": "A list with zero or more flights",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "flightId": {
            "description": "Flight number",
            "type": "string"
          },
          "departureAirportSwedish": {
            "description": "Departure airport name in Swedish",
            "type": "string"
          },
          "departureAirportEnglish": {
            "description": "Departure airport name in English",
            "type": "string"
          },
          "airlineOperator": {
            "type": "object",
            "properties": {
              "iata": {
                "description": "The iata code of the party operating the flight",
                "type": "string"
              },
              "icao": {
                "description": "The iata code of the party operating the flight",
                "type": "string"
              },
              "name": {
                "description": "The party operating the flight",
                "type": "string"
              }
            }
          },
          "arrivalTime": {
            "type": "object",
            "properties": {
              "scheduledUtc": {
                "format": "date-time",
                "description": "Scheduled time of arrival in UTC",
                "type": "string"
              },
              "estimatedUtc": {
                "format": "date-time",
                "description": "Estimated time of arrival in UTC",
                "type": "string"
              },
              "actualUtc": {
                "format": "date-time",
                "description": "Actual time of arrival in UTC",
                "type": "string"
              }
            },
            "description": "Arrival time information"
          },
          "locationAndStatus": {
            "type": "object",
            "properties": {
              "terminal": {
                "description": "Terminal identifier",
                "type": "string"
              },
              "gate": {
                "description": "Uniquely defines one gate at the airport.",
                "type": "string"
              },
              "flightLegStatus": {
                "description": "The status of a FlightLeg.",
                "enum": [
                  "SCH",
                  "FPL",
                  "FLS",
                  "SEQ",
                  "ACT",
                  "CAN",
                  "LAN",
                  "RER",
                  "DIV",
                  "DEL"
                ],
                "type": "string"
              },
              "flightLegStatusSwedish": {
                "description": "Status text in Swedish",
                "type": "string"
              },
              "flightLegStatusEnglish": {
                "description": "Status text in English",
                "type": "string"
              }
            }
          },
          "baggage": {
            "type": "object",
            "properties": {
              "estimatedFirstBagUtc": {
                "format": "date-time",
                "type": "string"
              },
              "baggageClaimUnit": {
                "description": "Baggage belt",
                "type": "string"
              },
              "firstBagUtc": {
                "format": "date-time",
                "description": "UTC time for first bag on baggage belt",
                "type": "string"
              },
              "lastBagUtc": {
                "format": "date-time",
                "description": "UTC time for last bag on baggage belt",
                "type": "string"
              }
            },
            "description": "Information about where bags can be found."
          },
          "codeShareData": {
            "description": "Alternate flightId",
            "type": "array",
            "items": {
              "type": "string",
              "xml": {
                "name": "flightId"
              }
            },
            "xml": {
              "wrapped": true
            }
          },
          "flightLegIdentifier": {
            "type": "object",
            "properties": {
              "ifplId": {
                "description": "Initial Flight plan Identifier",
                "type": "string"
              },
              "callsign": {
                "description": "Uniquely identifies an aircraft using the airspace around an airport",
                "type": "string"
              },
              "aircraftRegistration": {
                "description": "Unique aircraft identifier",
                "type": "string"
              },
              "ssrCode": {
                "description": "Secondary Surveillance Radar Code",
                "type": "string"
              },
              "flightId": {
                "description": "Flight number",
                "type": "string"
              },
              "flightDepartureDateUtc": {
                "format": "date-time",
                "description": "Departure date in Utc",
                "type": "string"
              },
              "departureAirportIata": {
                "description": "Departure airport Iata code",
                "type": "string"
              },
              "arrivalAirportIata": {
                "description": "Arrival airport Iata code",
                "type": "string"
              },
              "departureAirportIcao": {
                "description": "Departure airport Icao",
                "type": "string"
              },
              "arrivalAirportIcao": {
                "description": "Arrival airport Icao",
                "type": "string"
              }
            },
            "description": "A set of fields that uniquely identifies a FlightLeg"
          },
          "remarksEnglish": {
            "description": "Remarks intended for FIDS screens in English",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string"
                },
                "indicator": {
                  "type": "string"
                }
              },
              "xml": {
                "name": "remark"
              }
            },
            "xml": {
              "wrapped": true
            }
          },
          "remarksSwedish": {
            "description": "Remarks intended for FIDS screens in Swedish",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string"
                },
                "indicator": {
                  "type": "string"
                }
              },
              "xml": {
                "name": "remark"
              }
            },
            "xml": {
              "wrapped": true
            }
          },
          "viaDestinations": {
            "description": "A list of airports a flight will land on the way to the (final) destination airport",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "airportIATA": {
                  "type": "string"
                },
                "airportSwedish": {
                  "type": "string"
                },
                "airportEnglish": {
                  "type": "string"
                }
              },
              "xml": {
                "name": "viaDestination"
              }
            },
            "xml": {
              "wrapped": true
            }
          },
          "diIndicator": {
            "description": "Indicator showing if the flight is domestic (D), international (I) or Schengen (S).",
            "type": "string"
          }
        },
        "xml": {
          "name": "flight"
        }
      },
      "xml": {
        "wrapped": true
      }
    }
  }
}
<arrivals>
  <to>
    <arrivalAirportIata>string</arrivalAirportIata>
    <arrivalAirportIcao>string</arrivalAirportIcao>
    <arrivalAirportSwedish>string</arrivalAirportSwedish>
    <arrivalAirportEnglish>string</arrivalAirportEnglish>
    <flightArrivalDate>string</flightArrivalDate>
  </to>
  <numberOfFlights>0</numberOfFlights>
  <flights>
    <flight>
      <flightId>string</flightId>
      <departureAirportSwedish>string</departureAirportSwedish>
      <departureAirportEnglish>string</departureAirportEnglish>
      <airlineOperator>
        <iata>string</iata>
        <icao>string</icao>
        <name>string</name>
      </airlineOperator>
      <arrivalTime>
        <scheduledUtc>string</scheduledUtc>
        <estimatedUtc>string</estimatedUtc>
        <actualUtc>string</actualUtc>
      </arrivalTime>
      <locationAndStatus>
        <terminal>string</terminal>
        <gate>string</gate>
        <flightLegStatus>SCH</flightLegStatus>
        <flightLegStatusSwedish>string</flightLegStatusSwedish>
        <flightLegStatusEnglish>string</flightLegStatusEnglish>
      </locationAndStatus>
      <baggage>
        <estimatedFirstBagUtc>string</estimatedFirstBagUtc>
        <baggageClaimUnit>string</baggageClaimUnit>
        <firstBagUtc>string</firstBagUtc>
        <lastBagUtc>string</lastBagUtc>
      </baggage>
      <codeShareData>
        <flightId>string</flightId>
      </codeShareData>
      <flightLegIdentifier>
        <ifplId>string</ifplId>
        <callsign>string</callsign>
        <aircraftRegistration>string</aircraftRegistration>
        <ssrCode>string</ssrCode>
        <flightId>string</flightId>
        <flightDepartureDateUtc>string</flightDepartureDateUtc>
        <departureAirportIata>string</departureAirportIata>
        <arrivalAirportIata>string</arrivalAirportIata>
        <departureAirportIcao>string</departureAirportIcao>
        <arrivalAirportIcao>string</arrivalAirportIcao>
      </flightLegIdentifier>
      <remarksEnglish>
        <remark>
          <text>string</text>
          <indicator>string</indicator>
        </remark>
      </remarksEnglish>
      <remarksSwedish>
        <remark>
          <text>string</text>
          <indicator>string</indicator>
        </remark>
      </remarksSwedish>
      <viaDestinations>
        <viaDestination>
          <airportIATA>string</airportIATA>
          <airportSwedish>string</airportSwedish>
          <airportEnglish>string</airportEnglish>
        </viaDestination>
      </viaDestinations>
      <diIndicator>string</diIndicator>
    </flight>
  </flights>
</arrivals>
{
  "type": "object",
  "properties": {
    "to": {
      "type": "object",
      "properties": {
        "arrivalAirportIata": {
          "description": "Iata code for arrival airport",
          "type": "string"
        },
        "arrivalAirportIcao": {
          "description": "Icao code for arrival airport",
          "type": "string"
        },
        "arrivalAirportSwedish": {
          "description": "Arrival airport name in Swedish",
          "type": "string"
        },
        "arrivalAirportEnglish": {
          "description": "Arrival airport name in English",
          "type": "string"
        },
        "flightArrivalDate": {
          "description": "Arrival date in UTC",
          "type": "string"
        }
      },
      "description": "Arriving to"
    },
    "numberOfFlights": {
      "format": "int32",
      "description": "Number of flights in response",
      "type": "integer"
    },
    "flights": {
      "description": "A list with zero or more flights",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "flightId": {
            "description": "Flight number",
            "type": "string"
          },
          "departureAirportSwedish": {
            "description": "Departure airport name in Swedish",
            "type": "string"
          },
          "departureAirportEnglish": {
            "description": "Departure airport name in English",
            "type": "string"
          },
          "airlineOperator": {
            "type": "object",
            "properties": {
              "iata": {
                "description": "The iata code of the party operating the flight",
                "type": "string"
              },
              "icao": {
                "description": "The iata code of the party operating the flight",
                "type": "string"
              },
              "name": {
                "description": "The party operating the flight",
                "type": "string"
              }
            }
          },
          "arrivalTime": {
            "type": "object",
            "properties": {
              "scheduledUtc": {
                "format": "date-time",
                "description": "Scheduled time of arrival in UTC",
                "type": "string"
              },
              "estimatedUtc": {
                "format": "date-time",
                "description": "Estimated time of arrival in UTC",
                "type": "string"
              },
              "actualUtc": {
                "format": "date-time",
                "description": "Actual time of arrival in UTC",
                "type": "string"
              }
            },
            "description": "Arrival time information"
          },
          "locationAndStatus": {
            "type": "object",
            "properties": {
              "terminal": {
                "description": "Terminal identifier",
                "type": "string"
              },
              "gate": {
                "description": "Uniquely defines one gate at the airport.",
                "type": "string"
              },
              "flightLegStatus": {
                "description": "The status of a FlightLeg.",
                "enum": [
                  "SCH",
                  "FPL",
                  "FLS",
                  "SEQ",
                  "ACT",
                  "CAN",
                  "LAN",
                  "RER",
                  "DIV",
                  "DEL"
                ],
                "type": "string"
              },
              "flightLegStatusSwedish": {
                "description": "Status text in Swedish",
                "type": "string"
              },
              "flightLegStatusEnglish": {
                "description": "Status text in English",
                "type": "string"
              }
            }
          },
          "baggage": {
            "type": "object",
            "properties": {
              "estimatedFirstBagUtc": {
                "format": "date-time",
                "type": "string"
              },
              "baggageClaimUnit": {
                "description": "Baggage belt",
                "type": "string"
              },
              "firstBagUtc": {
                "format": "date-time",
                "description": "UTC time for first bag on baggage belt",
                "type": "string"
              },
              "lastBagUtc": {
                "format": "date-time",
                "description": "UTC time for last bag on baggage belt",
                "type": "string"
              }
            },
            "description": "Information about where bags can be found."
          },
          "codeShareData": {
            "description": "Alternate flightId",
            "type": "array",
            "items": {
              "type": "string",
              "xml": {
                "name": "flightId"
              }
            },
            "xml": {
              "wrapped": true
            }
          },
          "flightLegIdentifier": {
            "type": "object",
            "properties": {
              "ifplId": {
                "description": "Initial Flight plan Identifier",
                "type": "string"
              },
              "callsign": {
                "description": "Uniquely identifies an aircraft using the airspace around an airport",
                "type": "string"
              },
              "aircraftRegistration": {
                "description": "Unique aircraft identifier",
                "type": "string"
              },
              "ssrCode": {
                "description": "Secondary Surveillance Radar Code",
                "type": "string"
              },
              "flightId": {
                "description": "Flight number",
                "type": "string"
              },
              "flightDepartureDateUtc": {
                "format": "date-time",
                "description": "Departure date in Utc",
                "type": "string"
              },
              "departureAirportIata": {
                "description": "Departure airport Iata code",
                "type": "string"
              },
              "arrivalAirportIata": {
                "description": "Arrival airport Iata code",
                "type": "string"
              },
              "departureAirportIcao": {
                "description": "Departure airport Icao",
                "type": "string"
              },
              "arrivalAirportIcao": {
                "description": "Arrival airport Icao",
                "type": "string"
              }
            },
            "description": "A set of fields that uniquely identifies a FlightLeg"
          },
          "remarksEnglish": {
            "description": "Remarks intended for FIDS screens in English",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string"
                },
                "indicator": {
                  "type": "string"
                }
              },
              "xml": {
                "name": "remark"
              }
            },
            "xml": {
              "wrapped": true
            }
          },
          "remarksSwedish": {
            "description": "Remarks intended for FIDS screens in Swedish",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string"
                },
                "indicator": {
                  "type": "string"
                }
              },
              "xml": {
                "name": "remark"
              }
            },
            "xml": {
              "wrapped": true
            }
          },
          "viaDestinations": {
            "description": "A list of airports a flight will land on the way to the (final) destination airport",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "airportIATA": {
                  "type": "string"
                },
                "airportSwedish": {
                  "type": "string"
                },
                "airportEnglish": {
                  "type": "string"
                }
              },
              "xml": {
                "name": "viaDestination"
              }
            },
            "xml": {
              "wrapped": true
            }
          },
          "diIndicator": {
            "description": "Indicator showing if the flight is domestic (D), international (I) or Schengen (S).",
            "type": "string"
          }
        },
        "xml": {
          "name": "flight"
        }
      },
      "xml": {
        "wrapped": true
      }
    }
  }
}

204 No Content

NoContent

304 Not Modified

NotModified

400 Bad Request

BadRequest

500 Internal Server Error

InternalServerError

Code samples

@ECHO OFF

curl -v -X GET "https://api.swedavia.se/flightinfo/v2/{airportIATA}/arrivals/{date}"
-H "Accept: application/json"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers

            client.DefaultRequestHeaders.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json"));
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://api.swedavia.se/flightinfo/v2/{airportIATA}/arrivals/{date}?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://api.swedavia.se/flightinfo/v2/{airportIATA}/arrivals/{date}");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Accept", "application/json");
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
        };
      
        $.ajax({
            url: "https://api.swedavia.se/flightinfo/v2/{airportIATA}/arrivals/{date}?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Accept","application/json");
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://api.swedavia.se/flightinfo/v2/{airportIATA}/arrivals/{date}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://api.swedavia.se/flightinfo/v2/{airportIATA}/arrivals/{date}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Accept' => 'application/json',
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Accept': 'application/json',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('api.swedavia.se')
    conn.request("GET", "/flightinfo/v2/{airportIATA}/arrivals/{date}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Accept': 'application/json',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('api.swedavia.se')
    conn.request("GET", "/flightinfo/v2/{airportIATA}/arrivals/{date}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://api.swedavia.se/flightinfo/v2/{airportIATA}/arrivals/{date}')

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Accept'] = 'application/json'
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body