Forum Discussion

GoOnYahGoodThin's avatar
GoOnYahGoodThin
New Contributor
10 months ago

Newbie: REST POST to localhost (Visual Studio Debugger running C#) gets changed to GET to other port

Hi,

Apologies for newbie level of this post.

This has me foxed becuase it only happens on localhost, if I send a PUT to a version of my API deployed on IIS or Kestrel then this problem doesn't occur.

But I was hoping to be able to run tests on my code without having to go through the rigmarole of deploying it.

 

So I fire up the debugger in Visual Studio (2020)... and run the API which normally resides on port 5020 for me (http)

Then I try to get SoapUI (5.4.0) to send a PUT to http://localhost:5020/mystuff .... only to have it fail..

 

The Raw output reads as below.. it looks to me like it changes the PUT request to a GET and sends it to port 5021 .. 

This happens whether I have app.UseHsts() in my code or not...

 

I have read in a few places that this kind of thing was fixed in 5.3 of SOAPUI but I may be confused...

I also tried turning Follow Redirects to false but that doesn't appear to make a difference...

 

Thanks in advance for any help...

 

RAW OUTPUT:

GET https://localhost:5021/mystuff
Accept-Encoding: gzip,deflate
Host: localhost
Accept-Encoding: gzip,deflate
Content-Type: application/json
Content-Length: 926
Host: localhost:5020
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

 

------------------------------------------------------

SoapUI 5.4.0 Build Date: 20171204-0633

Running on windows server 2016