6

I'm getting a 400 bad request error message when accessing an ASP.net web api via a url that uses the computer name. When I use localhost it works fine. I'm using the iisExpress for visual studio 2012.

Any help is appreciated! Thanks in advance!

7
  • did you try using the FQDN or the IP Address? Commented Jun 20, 2013 at 20:52
  • 1
    are you using iis or iis express to host the application? Commented Jun 20, 2013 at 20:55
  • Hello, thank you for taking time to read and respond. I'm using iis express and computer name but not fully qualified. In my hosts file I have my computer name set to 127.0.0.1. I will try using the fully qualified name to see if it helps Commented Jun 25, 2013 at 20:09
  • I tried it with the fully qualified domain name added to my computer name and still get the same error. The reason why I need to use the computer name instead of localhost is that I want to trace it with fiddler. Fiddler will not work with localhost. When I use my computer name, I am able to get fiddler to log but then I get the error "HTTP Error 400. The request hostname is invalid." from the ASP.net web api. Commented Jun 25, 2013 at 20:26
  • How is the site in IIS Express configured? Does it expect a hostname when requests are sent to it? Commented Jul 2, 2013 at 15:46

2 Answers 2

7

I found the answer to this from another post on here. I had to update my IISExpress' applicationhost.config file and add a binding with my computer name on it.

The link to the other post is here: Configure IIS Express for external access to VS2010 project

Sign up to request clarification or add additional context in comments.

Comments

0

If you prefer not to change configurations, you can use our free VS extension called Conveyor

https://marketplace.visualstudio.com/items?itemName=vs-publisher-1448185.ConveyorbyKeyoti

1 Comment

@user3419036 no, it is free. The premium version is $30 that's all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.