hrbrmstr / curlconverter

:curly_loop: :arrow_right: :heavy_minus_sign: Translate cURL command lines into parameters for use with httr or actual httr calls (R)
http://rud.is/b/2016/02/10/craft-httr-calls-cleverly-with-curlconverter/
Other
91 stars 12 forks source link

Enhancement : req from straighten #2

Closed RCura closed 8 years ago

RCura commented 8 years ago

Currently, with a defined curl string, you can either turn it into a "readable" R object with straighten(), or into a httr request with make_req().

Those two function don't work together : they both use the same argument, that is the curl request string.

We should have a function that takes the straighten() result as input, and creates a request, just like make_req() does with plain string curl.

If straighten result can't be used again for a request, I can't understand its point.

hrbrmstr commented 8 years ago

That's a good idea. The thought was to have a function which folks could get the parts in list form to inspect. I'll ponder what a revised architecture might look like.

-Bob

On Thu, Feb 11, 2016 at 11:52 AM, Robin Cura notifications@github.com wrote:

Currently, with a defined curl string, you can either turn it into a "readable" R object with straighten(), or into a httr request with make_req().

Those two function don't work together : they both use the same argument, that is the curl request string.

We should have a function that takes the straighten() result as input, and creates a request, just like make_req() does with plain string curl.

If straighten result can't be used again for a request, I can't understand its point.

— Reply to this email directly or view it on GitHub https://github.com/hrbrmstr/curlconverter/issues/2.

RCura commented 8 years ago

My point is that I have to "craft" curl request in R, i.e. take a curl request and edit it before executing it. I thought curlconverter would allow me to do this easily using straighten() so as to have the parts of the request in a structured form, edit some of the parts (for example the url, keeping the cookies), and then execute it.

Right now, to do this, I would have to do some nasty string handling in R, and curlconverter seems like a very nice way to ease this workflow :smile:

ghost commented 8 years ago

Well, the other function spits out such a beast in text form :-) The original driver for this was to make it easier to answer some StackOverflow questions, but I can see it has more utility. I'm rly glad you poked at this since it'll really help make the pkg usable to a wide audience.

From: Robin Cura notifications@github.com<mailto:notifications@github.com> Reply-To: hrbrmstr/curlconverter reply@reply.github.com<mailto:reply@reply.github.com> Date: Thursday, February 11, 2016 at 12:56 PM To: hrbrmstr/curlconverter curlconverter@noreply.github.com<mailto:curlconverter@noreply.github.com> Subject: Re: [curlconverter] Enhancement : req from straighten (#2)

My point is that I have to "craft" curl request in R, i.e. take a curl request and edit it before executing it. I thought curlconverter would allow me to do this easily using straighten() so as to have the parts of the request in a structured form, edit some of the parts (for example the url, keeping the cookies), and then execute it.

Right now, to do this, I would have to do some nasty string handling in R, and curlconverter seems like a very nice way to ease this workflow [:smile:]

— Reply to this email directly or view it on GitHubhttps://github.com/hrbrmstr/curlconverter/issues/2#issuecomment-182979274.

RCura commented 8 years ago

Seems to work like a charm with your latest commit. Thanks a lot, will try this on real data asap ! Kudos for the amazing work !

hrbrmstr commented 8 years ago

thx. keep the suggestions coming!