From: Richy <kle...@gm...> - 2010-06-11 02:41:35
|
Dear List, this is probably a rather simple question, however I have failed to find a solution. I'm trying to use cpp-netlib with couchdb in a project. CouchDB uses Views to get data and it is possible to filter result by passing a key. In my case that key would be in the form of: ["key1", "key2"] I figured out that one has to manually escape the quotation-signs, but I'm not aware of am escape sequence for the [ sign. However, it doesn't get transmitted and the rest is skipped as well. sample-Code. std::string requestURI = dbUrl; requestURI.append("/_design/user/_view/getUserHistory?key=[%22"); requestURI.append(missionID); requestURI.append("%22,%22"); requestURI.append(userID); requestURI.append("%22]"); http::client client(http::client::follow_redirects); http::client::request request(requestURI); http::client::response response = client.get(request); I hope the answer is not too obvious but still out there. Any help would be appreciated! Thanks a lot Richard |
From: Dean M. B. <mik...@gm...> - 2010-06-11 03:33:15
|
Hi Richy, On Fri, Jun 11, 2010 at 10:41 AM, Richy <kle...@gm...> wrote: > Dear List, > > this is probably a rather simple question, however I have failed to > find a solution. > > I'm trying to use cpp-netlib with couchdb in a project. > CouchDB uses Views to get data and it is possible to filter result by > passing a key. In my case that key would be in the form of: > ["key1", "key2"] > > I figured out that one has to manually escape the quotation-signs, but > I'm not aware of am escape sequence for the [ sign. However, it > doesn't get transmitted and the rest is skipped as well. > sample-Code. You will need to use %5B for '[' and %5D for ']'. You can get a table from http://www.w3schools.com/TAGS/ref_urlencode.asp That said, it would be nice if someone can write a urlencode function -- maybe as a Karma generator? :D Any takers? I would love to see one in boost/network/protocol/http/utils/ -- so if you have tests and an implementation on your fork, I would love to get this in 0.7. :) -- Dean Michael Berris deanberris.com |
From: Jeroen H. <vex...@gm...> - 2010-06-11 07:29:03
|
Hi, On 11 June 2010 05:32, Dean Michael Berris <mik...@gm...> wrote: > Hi Richy, > > On Fri, Jun 11, 2010 at 10:41 AM, Richy <kle...@gm...> wrote: >> Dear List, >> >> this is probably a rather simple question, however I have failed to >> find a solution. >> >> I'm trying to use cpp-netlib with couchdb in a project. >> CouchDB uses Views to get data and it is possible to filter result by >> passing a key. In my case that key would be in the form of: >> ["key1", "key2"] >> >> I figured out that one has to manually escape the quotation-signs, but >> I'm not aware of am escape sequence for the [ sign. However, it >> doesn't get transmitted and the rest is skipped as well. >> sample-Code. > > You will need to use %5B for '[' and %5D for ']'. > > You can get a table from http://www.w3schools.com/TAGS/ref_urlencode.asp > > That said, it would be nice if someone can write a urlencode function > -- maybe as a Karma generator? :D Any takers? > > I would love to see one in boost/network/protocol/http/utils/ -- so if > you have tests and an implementation on your fork, I would love to get > this in 0.7. :) > > -- > Dean Michael Berris > deanberris.com > There's a url_decode and url_encode function already in http://github.com/mikhailberis/cpp-netlib/blob/master/boost/network/protocol/http/impl/message.ipp. Though I agree a Karma version would look better :) Jeroen |
From: Dean M. B. <mik...@gm...> - 2010-06-11 07:37:30
|
On Fri, Jun 11, 2010 at 3:28 PM, Jeroen Habraken <vex...@gm...> wrote: > > On 11 June 2010 05:32, Dean Michael Berris <mik...@gm...> wrote: >> >> That said, it would be nice if someone can write a urlencode function >> -- maybe as a Karma generator? :D Any takers? >> >> I would love to see one in boost/network/protocol/http/utils/ -- so if >> you have tests and an implementation on your fork, I would love to get >> this in 0.7. :) >> > > There's a url_decode and url_encode function already in > http://github.com/mikhailberis/cpp-netlib/blob/master/boost/network/protocol/http/impl/message.ipp. > Though I agree a Karma version would look better :) > Yeah... So you'll do it then? :D -- Dean Michael Berris deanberris.com |
From: Jeroen H. <vex...@gm...> - 2010-06-11 07:50:59
|
On 11 June 2010 09:37, Dean Michael Berris <mik...@gm...> wrote: > On Fri, Jun 11, 2010 at 3:28 PM, Jeroen Habraken <vex...@gm...> wrote: >> >> On 11 June 2010 05:32, Dean Michael Berris <mik...@gm...> wrote: >>> >>> That said, it would be nice if someone can write a urlencode function >>> -- maybe as a Karma generator? :D Any takers? >>> >>> I would love to see one in boost/network/protocol/http/utils/ -- so if >>> you have tests and an implementation on your fork, I would love to get >>> this in 0.7. :) >>> >> >> There's a url_decode and url_encode function already in >> http://github.com/mikhailberis/cpp-netlib/blob/master/boost/network/protocol/http/impl/message.ipp. >> Though I agree a Karma version would look better :) >> > > Yeah... So you'll do it then? :D > > -- > Dean Michael Berris > deanberris.com > Sure, I can't give you and ETA though, I'm way too busy at the moment. Jeroen |
From: Dean M. B. <mik...@gm...> - 2010-06-11 07:55:47
|
On Fri, Jun 11, 2010 at 3:50 PM, Jeroen Habraken <vex...@gm...> wrote: > On 11 June 2010 09:37, Dean Michael Berris <mik...@gm...> wrote: >> >> Yeah... So you'll do it then? :D >> > > Sure, I can't give you and ETA though, I'm way too busy at the moment. > No worries, I don't like giving ETA's too since I'm doing this on my free time as well. ;) Have a great weekend! -- Dean Michael Berris deanberris.com |
From: Richy <kle...@gm...> - 2010-06-11 12:50:18
|
Thank you so much for that fast, easy and friendly reply. It is very much appreciated. On Fri, Jun 11, 2010 at 03:55, Dean Michael Berris <mik...@gm...> wrote: > On Fri, Jun 11, 2010 at 3:50 PM, Jeroen Habraken <vex...@gm...> wrote: >> On 11 June 2010 09:37, Dean Michael Berris <mik...@gm...> wrote: >>> >>> Yeah... So you'll do it then? :D >>> >> >> Sure, I can't give you and ETA though, I'm way too busy at the moment. >> > > No worries, I don't like giving ETA's too since I'm doing this on my > free time as well. ;) > > Have a great weekend! > > -- > Dean Michael Berris > deanberris.com > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Cpp-netlib-devel mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel > |