REST message through MID server - 404 error

jamesgo
Giga Contributor

I am trying to send make a post REST call (with json contents) through MID server but keep getting 404 error (response says "The requested resource is not available."). when I check the ECC queue I found the content-type of the post call is always "text/html;charset=utf-8" even I added "application/json" as content type in the REST message header...however I am not really sure if this is the root cause... the web services seem working fine if I make the same call in Chrome using Advanced REST client.

<httpHeaders><httpHeader name="Content-Language" value="en"/><httpHeader name="Date" value="Fri, 17 Jul 2015 16:08:32 GMT"/><httpHeader name="Content-Length" value="1005"/><httpHeader name="Content-Type" value="text/html;charset=utf-8"/><httpHeader name="Server" value="Apache-Coyote/1.1"/></httpHeaders>

Any idea how to trouble shoot this? any help is much appreciated!

5 REPLIES 5

siriprudhivi
ServiceNow Employee
ServiceNow Employee

Hi James,


If you are able to make the call through Advanced REST client, I am not sure why you need to go through MID server. Can you send directly and see if it behaves as expected?


Regards,


Siri


epam
Kilo Guru

Completely agree with Siri - why are you trying to send REST calls via MID Server when you are able to reach it without MID?


MID is only necessary when you need to access internal Network resource. In your case (successful usage of Advanced REST client) MID seems to be unnecessary.



Reference:


akzm
ServiceNow Employee
ServiceNow Employee

Not sure how connectivity from Advanced REST client makes it an external network!



The service endpoint could still be inside internal network - looks like his browser (Advanced REST client) is in there too.



Azfar


akzm
ServiceNow Employee
ServiceNow Employee

James,



This is weird. What release you are using? Also, can you share how you are setting the headers?



Also, one troubleshooting step is to make this call direct (knowing that it will fail) but turn the debug on (by setting glide.rest.debug property) and see if it is sending out same headers as you expect.



Azfar