Question: I'm having a problem doing a request using Typhoeus as my query needs to have quotation marks into it.

If the URl is

```
url = "http://app.com/method.json?'my_query'"

```

everything works fine. However, the method I'm trying to run only returns the results I want if the query is the following (i've tested it in browser):

```
url2 = "http://app.com/method.json?"my_query""

```

When running 

```
Typhoeus::Request.get(url2) 

```

I get (URI::InvalidURIError)

Escaping quotes with "\" does not work. How can I do this?

Thanks

Answer: 
You should be properly encoding your URI with [`URI.encode`](http://ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/Escape.html#M009396) or [`CGI.escape`](http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/classes/CGI.html#M000093), doing so will get you proper URLs like this:

```
http://app.com/method.json?%27my_query%27 # Single quotes
http://app.com/method.json?%22my_query%22 # Double quotes

```
Passing json, quotes etc in GET request is tricky. In Ruby 2+ we can use Ruby's URI module's 'escape' method.

```
> URI.escape('http://app.com/method.json?agent={"account":
{"homePage":"http://demo.my.com","name":"Senior Leadership"}}')

```

But I suggest use it as POST request and pass it as a message body.