I am trying to connect to the Sabre API using the following code:
Dim u As String = "https://developer.sabre.com/io-docs/call-api"
' Create the web request
request2 = DirectCast(WebRequest.Create(u), HttpWebRequest)
' Get response
response2 = DirectCast(request2.GetResponse(), HttpWebResponse)
' Get the response stream into a reader
reader2 = New StreamReader(response2.GetResponseStream())
' Console application output
' MsgBox(reader.ReadToEnd())
Response.Write(reader.ReadToEnd())
However I am getting the following error:
Server Error in '/' Application.
The remote server returned an error: (400) Bad Request.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote server returned an error: (400) Bad Request.
Source Error:
Line 49:
Line 50: ' Get response
Line 51: response2 = DirectCast(request2.GetResponse(), HttpWebResponse)
Line 52:
Line 53: ' Get the response stream into a reader
You are not referencing the correct Sabre API endpoints. I would recommend looking at the .Net Sabre API Code Sample for reference information.