Igor Goroshko
Igor Goroshko

Reputation: 263

Is it possible to send whitespace parameter in ASP.NET Web API?

I have a route [Route("terms/{term}")] with an action attribute: public void Update(string term, Term user)

The question is, how can I send whitespace {term} (e.g. " ", or "\t") to this route? Is that possible?

Upvotes: 2

Views: 1609

Answers (1)

Explisam
Explisam

Reputation: 749

I believe it is %20 what you're looking for. It is the equivalent of a space.

*You can also use + but to be specific, it's all internal terms not used by the URL encoder.

Edit:

Add this line to your web.config:

<httpRuntime relaxedUrlToFileSystemMapping="true"/>

Upvotes: 3

Related Questions