Having an issue where I get a 502, Error in establishing connection message about 50% of the time when trying to reach an API endpoint. I never have an issue reaching the endpoint using Postman, only using the Request Method
The call is a little slow to respond, so not sure if there is some timeout I am hitting or what.
Below is the error I am getting and the function that calls the Request Method.
findBarcodeData() {
console.log('Searching', this.barcodeSearch)
this.barcodeSearch = this.barcodeSearch.trim()
var headers = {"Accept": "application/json", "Authorization": "Bearer <%= iparam.apiToken %>"};
var options = { headers: headers };
var url = "https://xxxxxx.xxxxxxxxx.com/api/barcodes/find/" + this.barcodeSearch
client.request.get(url, options)
.then(
function(data) {
if (appLocation == 'new_ticket_requester_info') {
populateSupplyFieldsNew('barcode', data)
};
if (appLocation == 'ticket_requester_info') {
populateSupplyFieldsExisting('barcode', data);
};
},
function(error) {
console.log(error)
})
},
Anyone have any ideas?