-1

i have 2 application . coreproject and clientproject. i send a string text from clinetproject to coreproject. i have only one problem to send plus (+) chacter to coreproject . for example my requset url ecive to coreproject is Request = {Method: GET, RequestUri: 'http://localhost:whateever/api/v1/Search/Search?Query=++++++&PageNumber=1&PageSize=5', Version: 1.1, Content: System.Web.Http.WebHost.HttpControllerHandler+LazyStreamContent, Headers: { Accept: application/json Host: localhost:...

and but my actionContext.ModelState.IsValid is false
my string text in clinet project is ++++++ but it recive to coreproject and change to " " and model.isvalid is false ? why?

Amin Saadati
  • 719
  • 8
  • 21

1 Answers1

4

In query part plus sign mean space. If you want sent plus sign you have to encode it with %2b.

So now you RequestUri should look like:

http://localhost:whateever/api/v1/Search/Search?Query=%2b%2b%2b%2b%2b%2b&PageNumber=1&PageSize=5', 
Sousuke
  • 1,203
  • 1
  • 15
  • 25