1

I am sending a string to a Post method in WebApi. The string contains a # character. When the Post method receives it, the string is received without the # character and everything after it.

So if the string I send is

abc#def

The Post method actually receives

abc

What's wrong here?

Sachin Kainth
  • 45,256
  • 81
  • 201
  • 304

1 Answers1

1

As this parameter is passed in the URI, anything after the # is ignored. This is standard web behaviour. You simply cannot do this sorry.

One thing you could do is take it in via the request body instead, that would work fine.

A similar question addresses the same issue here, although it's more to do with routing, but the same concept applies.

Community
  • 1
  • 1
demoncodemonkey
  • 11,730
  • 10
  • 61
  • 103