Help getting Agent to call cloud API with unique port


#1

Hi,

I’m getting a 404 response when I try to call my cloud API. If I put the URL in my browser/postman, I get a 200. My URL runs on a port other than 80. Is there a way to debug to make sure the agent is calling the right address with HTTPS, using the correct port, and resource? It isn’t clear in the Docs for the “http.put(URL, headers, body)” function the formatting of the URL when you have unique ports or encoding. The code is

const APIURL = “https://servername.azure.com:10080/resource”;
local request = http.put(APIURL, {}, “”);
request.sendasync(handleResponse);


#2

Looking into this; I don’t believe there should be a problem there but we’re verifying it now.


#3

@SRose can you please privately send to me the actual URL that you are using? Thanks.


#4

@SRose I’ve just tested this with the URL you provided by email. The results are consistent between the agent, Postman, and a web browser. GET requests return 404. PUT requests return 403, as expected.


#5

@zandr That’s good news. Only PUT is allowed. However the http.put() call in my agent is returning a 404. Are you able to see my agent code? I’m working on getting logging from our servers…


#6

I can’t see your agent code, no. I’ll contact you by email for it.
I think, though that the fact that I’m getting 403 with bogus auth means we’re hitting the right server:port, and it’s something about the request that isn’t quite right.


#7

@zandr Case Closed. Figured it out! Thanks for all your help. My dev team got back. The api doc is wrong. It should be a Post, not a Put.