Question

I'm trying to parse the Mochi Media API on my site. Unfortunately, they make use of colons in their API URLs....

http://feedmonger.mochimedia.com/feeds/query/?q=(recommendation:>=0) and category:action&partner_id=XXXX

The question is, using httparty, how do I parse that url given that the :query/options hash will automatically convert to a standard query string:

get('/myNewApiUrl', :query => {:key => value}) | http://base/myNewApiUrl?key=value&key2=value2

I need something to handle this:

get('/myNewApiUrl', :query => {:key => value}) | http://base/myNewApiUrl?key:value&key2=value2

Can anyone help me out... just about ready to bang my head against a wall. :/

Was it helpful?

Solution

Ok, I was able to solve this by using a variable that I then passed along to the httparty's get method.

i.e.

url = ["URL-UP-TO-/?query=CATEGORY:",category].join("")
get(url)

Hopefully this helps someone else looking to use httparty. The GEM is really impressive!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top