ASP.Net: HTTP 400 Bad Request error when trying to process http://localhost:5957/http://yahoo.com

后端 未结 12 2409
小鲜肉
小鲜肉 2020-12-21 02:04

I\'m trying to create something similar to the diggbar.

I\'m using Visual Studio 2010 and Asp Development server.

However, I can\'t get the ASP dev server

12条回答
  •  粉色の甜心
    2020-12-21 02:52

    I've had exactly this problem in creating a URL shortener for ASP.net. For the life of me, I could not get the colon encoded in such a way that ASP would accept it, using either HttpUtility.UrlEncode or javascript's escape() on the client-side.

    My solution what to do Base64 encoding. Turns the whole thing into non-controversial alpha-numerics. Then you decode on the server. I used these functions.

    Also, I created an HttpModule to be triggered by a leading hyphen so I know to handle what follows as a URL to be decoded. Ping me if you want further details.

提交回复
热议问题