When attempting to make an HTTP GET call, the service returns a 500 error because in the querystring the + encoded symbol must be used instead of spaces. Ex .: LOS + ANGELES = LOS ANGELES
autocomplete(term: string){
var url = this.serviceUrl + 'autocomplete?query=' + term + '&limit=5';
console.log(url);
return this.http
.get(url, { headers: this.headers })
.map((res: Response) => res.json());
}
Error returned while trying to make a call by passing some text with space, eg: los angeles.
status
:
500
statusText
:
"Internal Server Error"
type
:
2
url
:
"https://api.test.sabre.com/v1/lists/utilities/geoservices/autocomplete?query=los%20a&limit=5"
_body
:
"{"status":"Unknown","reportingSystem":"RAF","timeStamp":"2017-09-21T12:03:40+00:00","type":"Application","errorCode":"ERR.RAF.APPLICATION","instance":"raf-darhlc006-9080","message":"Illegal character in query at index 75