This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14969|Reply: 0

[ASP.NET] asp.net about the question of the # character in the parameter

[Copy link]
Posted on 5/20/2016 10:53:13 PM | | | |


A few days ago, I found a problem, which is to write a call interface based on the API of the document.

Documents, there are incoming parameters and outgoing parameters, and during the transmission process, you need to bring a token, the token is fixed,

The value of the token has a # sign in it, for example: ABC#123

Then, there is an API interface that needs to pass in a parameter with an id of type int and make a request with GET

Then, I brought the parameters of token and id, and then the interface reported an error, which was an error that could not be converted to int32 type.

That's probably it, and then, I changed the browser and tried it, but it still got the same error, what's going on????

In the end, after a long time, the id of tmd was not transmitted, because if the id was not passed, it would also report an error that could not be converted to int32.

Then, I found that the parameters after the # sign are not parsed, and you can understand that comments and the like, anyway, the browser did not send the data after #.

In the end, I swapped the id and token, id first, token later, and it worked!! The data was requested, and then, I removed the characters after # in the token.

The same request succeeded!!! So why does the token in the document give me the entire token with the # sign!! #号后面的字符根本就不会传给后台, it's really annoying!!




Previous:c# Verify that the filtering proxy IP is valid
Next:Prohibit win10 update prompts and completely block win10 update prompts
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com