Kale
Kale

Reputation: 65

Uri.EscapeUriString for a query

I'm trying to trying to get this query to work:

  HttpWebRequest request = WebRequest.Create("&query=select * from person limit1")
  as HttpWebRequest;

but what i need to do for that is put %20 for ever space like this:

HttpWebRequest request = WebRequest.Create( 
"&query=select%20*%20from%20person%20limit%201") 
as HttpWebRequest;

but i want to do that automaticly and read that Uri.EscapeUriString was the best way to do that but i don't know how to implement that.

I hope you guys can help.

Upvotes: 0

Views: 286

Answers (1)

David
David

Reputation: 218828

Like this?:

WebRequest.Create(Uri.EscapeUriString("&query=select * from person limit1"))

Or am I missing something?

Upvotes: 2

Related Questions