Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8419595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:39:26+00:00 2026-06-10T02:39:26+00:00

Why does this url resolve in 400 – Bad Request? http://localhost:2785/api/ticker/Web.App.QuotesReaders/search=se%3Aabb My environment is

  • 0

Why does this url resolve in 400 – Bad Request?

http://localhost:2785/api/ticker/Web.App.QuotesReaders/search=se%3Aabb

My environment is Visual Studio 2010, MVC 4 and the controller used is a WebApiController.

The %3A is an URL-encoded colon.

SOLUTION

This works for some reason:

http://localhost:2785/api/ticker?className=Web.App.QuotesReaders&search=se%3Aabb

… which means, I couldn’t specify this route in global.asax.cs:

/api/ticker/{className}/{search}

… nor this …

/api/ticker/{className}/search={search}

… but this …

/api/ticker

For further information: http://www.hanselman.com/blog/ExperimentsInWackinessAllowingPercentsAnglebracketsAndOtherNaughtyThingsInTheASPNETIISRequestURL.aspx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:39:28+00:00Added an answer on June 10, 2026 at 2:39 am

    It seems that ASP.net does not allow colons before the ‘?’ in an URL, even if it is encoded as %3A.

    For example, these won’t work

    http://foo.org/api/persons/foo:bar
    http://foo.org/api/persons/foo%3abar

    But this works:
    http://foo.org/api/persons?id=foo%3abar

    In all examples, we would expect ASP.NET MVC to pass “foo:bar” as an id argument, properly decoded. I just tested this with MVC4 and it seems to work. It is annoying that it doesn’t accept the URL encoding before the question mark though, but I’m sure there is a good reason for it. Probably to keep everything before the question mark a valid URL and any arguments after the question mark.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First look at this url: https://stackoverflow.com/questions/tagged/xoxoxo/ This directory does not exists but somehow stackoverflow
Does this work in > iOS 5? .element { background: url(images/myImage.jpg) 50% 0 no-repeat
background: url({{ MEDIA_URL }}/bg.jpg); That does not work, because this Django template function only
How does django-admin resolves model from url? I takes url like this /admin/video/item/ How
I'm trying to call a server-side action in a controller from jQuery: $.ajax({ url:'http://localhost:88/admin/business/11/GetChildBusinessTypes',
I am getting this error: The length of the URL for this request exceeds
For some reason I get public in my url like this: http://www.mywebsite.com/public/ This should
Does this code always evaluate to false? Both variables are two's complement signed ints.
Does this function has the same behavior that memset ? inline void SetZeroArray( void
Does this work well as a Singleton in actionscript? i.e. are there any gotchas

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.