first SkyScanner Document say
Response Details
A successful response contains no content. The URL to poll the booking details is specified in the Location header of the response.
and
How to retrieve Session key from Skyscanner API post request - Ruby this link say response successful -> Location header return "sessionKey"
My Problem is response successful but Location header return null...
I use Okhttp lib and
Here is my code
public String post(String url, String json) throws IOException {
try {
RequestBody body = RequestBody.create(JSON, json);
Request request = new Request
.Builder()
.url(url)
.post(body)
.addHeader("Content-Type", "application/x-www-form-urlencode")
.addHeader("Accept", "application/json")
.build();
Response response = client.newCall(request).execute();
Log.v("Response", "code : " + response.code());
Log.v("Response", "message : " + response.message());
Log.v("Response", "location : " + response.header("location"));
return response.body().string();
} catch (Exception e) {
return "";
}
}
And My log
10-20 20:01:00.698 22202-22408/com.example.park.myapplication V/Response: code : 200
10-20 20:01:00.698 22202-22408/com.example.park.myapplication V/Response: message : OK
10-20 20:01:00.698 22202-22408/com.example.park.myapplication V/Response: location : null
What should I do? please find my Session Key...