Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue Using Fiddler for HTTP GET Containing OData Commands

I am trying to use Fiddler to do an HTTP GET to my ASP.NET Web API Odata endpoint service. The URL contains OData commands to filter the results. I can use a browser or the Google extension 'Postman' and run the query and it works.

However, immediately upon placing the URL in Fiddler's 'Composer' tab it turns red. Upon executing the GET I get the following error:

HTTP Error 400. The request is badly formed

It's a bit of a red herring though as I think Fiddler had a problem with composing and sending the proper request that resulted in the response. Here is the URL with OData commands:

http://localhost/MyApp/odata/People()?$filter=Name eq 'John'

As mentioned, this query works in other tools, just not in Fiddler. As I am not a Fiddler expert and did not intuitively see and options to allow this or find any documentation, can anyone tell me if it's possible to compose and send this type of GET with OData commands using Fiddler?

like image 471
atconway Avatar asked Apr 26 '13 17:04

atconway


1 Answers

Maybe Fiddler isn't automatically encoding spaces, like other tools might be? Try:

http://localhost/MyApp/odata/People()?$filter=Name%20eq%20'John'

You might also try encoding the single quotes around the string value.

Another thought is that Fiddler has some known issues with using "localhost", which I usually work around by putting a dot ('.') after localhost in the request URI:

http://localhost./MyApp/odata/People()?$filter=Name%20eq%20'John'
like image 143
Jen S Avatar answered Nov 03 '22 09:11

Jen S