christophergregory / shopify-node-api

OAuth2 Module for Shopify API
MIT License
216 stars 74 forks source link

Send GET request with spaces in query #70

Closed patrickbolle closed 7 years ago

patrickbolle commented 7 years ago

Hi there, not sure if this is specific to your library... but I'm trying to query customers with a certain tag.

I can do the following - /admin/customers/search.json?query=tag:singleWord

But obviously, once I try and add a tag with spaces in it I get errors - /admin/customers/search.json?query=tag:Waiting - 5kg Single Bag

TypeError: Request path contains unescaped characters

So I figured, okay - I'll escape the spaces and turn it into something like this:

Waiting%20-%205kg%20Single%20Bag

The request then goes through, but no customer is returned.

Is this something on the library end, or on Shopify's end?

Thanks so much! Love the library.

patrickbolle commented 7 years ago

Lol. Take out tag: in the query and it works perfectly fine! Woops!! Thanks.

nodeit commented 7 years ago

No problem! This is useful information for others that might run into the same thing.

MopideviAshok commented 7 years ago

/admin/customers.json/search.json?order=created_at ASC The above path is giving same error Exception: TypeError: Request path contains unescaped characters How to solve this?