From: Xeno Campanoli / Eskimo North and Gmail on 20 May 2010 23:23 On 10-05-20 07:30 PM, Eric Hodel wrote: > On May 20, 2010, at 10:45, Xeno Campanoli / Eskimo North and Gmail wrote: >> Among other things we have built the tool around curl facilities like the --trace-time function, and we don't want to mix in new stuff, or add variations in the kind of data we get. Also, all the switches for handling post data, HTTP headers, cookies, etc are working well, and it's not clear you can do all of those things, let alone in a reasonably good way, with the net/http. I am certainly interested in your opinion on that. >> >> Curl registers timestamps for points before the socket connection, as well as for receipt of each of the important HTTP headers, and then after the HTTP protocol activities are over the closure steps. Can I get that from net/http? > > Yes. Here's some pseudocode: I'm sorry. That is not pertinent to what I said. Perhaps you should learn curl. > > h = Net::HTTP.new > h.start do > p :connected! > > h.request do |r| > p :headers! > r.read_body > p :body! > end > end > -- "It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member
From: Eric Hodel on 20 May 2010 22:30 On May 20, 2010, at 10:45, Xeno Campanoli / Eskimo North and Gmail wrote: > Among other things we have built the tool around curl facilities like the --trace-time function, and we don't want to mix in new stuff, or add variations in the kind of data we get. Also, all the switches for handling post data, HTTP headers, cookies, etc are working well, and it's not clear you can do all of those things, let alone in a reasonably good way, with the net/http. I am certainly interested in your opinion on that. > > Curl registers timestamps for points before the socket connection, as well as for receipt of each of the important HTTP headers, and then after the HTTP protocol activities are over the closure steps. Can I get that from net/http? Yes. Here's some pseudocode: h = Net::HTTP.new h.start do p :connected! h.request do |r| p :headers! r.read_body p :body! end end
From: Robert Klemme on 20 May 2010 05:37 2010/5/19 Xeno Campanoli / Eskimo North and Gmail <xeno.campanoli(a)gmail.com>: > On 10-05-18 04:28 PM, Xeno Campanoli / Eskimo North and Gmail wrote: > > So, I installed rubycurl, that being the listed package of greatest > maturity, but no document I can find can seem to help me use it. Most of > the stuff on line refers to curb or multi-curb it seems. You could also use net/http which is part of the standar library and documented: http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/
From: Xeno Campanoli / Eskimo North and Gmail on 20 May 2010 10:18 On 10-05-20 02:37 AM, Robert Klemme wrote: > 2010/5/19 Xeno Campanoli / Eskimo North and Gmail<xeno.campanoli(a)gmail.com>: >> On 10-05-18 04:28 PM, Xeno Campanoli / Eskimo North and Gmail wrote: >> >> So, I installed rubycurl, that being the listed package of greatest >> maturity, but no document I can find can seem to help me use it. Most of >> the stuff on line refers to curb or multi-curb it seems. > > You could also use net/http which is part of the standar library and documented: > > http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html > > Kind regards > > robert > Yes, but I am trying to move from using curl on shell to getting the same functionality without the two extra forks to shell and to curl itself. Plus the native has a bad wrap, I don't know if it's deserved, but I haven't found it copasetic myself. -- "It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member
From: Xeno Campanoli / Eskimo North and Gmail on 20 May 2010 13:45 On 10-05-20 08:01 AM, Robert Klemme wrote: > 2010/5/20 Xeno Campanoli / Eskimo North and Gmail<xeno.campanoli(a)gmail.com>: >> On 10-05-20 02:37 AM, Robert Klemme wrote: >>> >>> 2010/5/19 Xeno Campanoli / Eskimo North and >>> Gmail<xeno.campanoli(a)gmail.com>: >>>> >>>> On 10-05-18 04:28 PM, Xeno Campanoli / Eskimo North and Gmail wrote: >>>> >>>> So, I installed rubycurl, that being the listed package of greatest >>>> maturity, but no document I can find can seem to help me use it. Most of >>>> the stuff on line refers to curb or multi-curb it seems. >>> >>> You could also use net/http which is part of the standar library and >>> documented: >>> >>> http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html >> >> Yes, but I am trying to move from using curl on shell to getting the same >> functionality without the two extra forks to shell and to curl itself. Plus >> the native has a bad wrap, I don't know if it's deserved, but I haven't >> found it copasetic myself. > > Why two forks? In order to start curl as an external process you just > need one fork and one exec (or use "system"). Also, why do you say > "but"? Net/HTTP does not need "curl" or any other external process so > I do not see how my suggestion contradicts your goal. On the > contrary, I deliberately suggested to use Net/HTTP in order to _not_ > have to depend on gems or external processes. > > Cheers > > robert > Among other things we have built the tool around curl facilities like the --trace-time function, and we don't want to mix in new stuff, or add variations in the kind of data we get. Also, all the switches for handling post data, HTTP headers, cookies, etc are working well, and it's not clear you can do all of those things, let alone in a reasonably good way, with the net/http. I am certainly interested in your opinion on that. Curl registers timestamps for points before the socket connection, as well as for receipt of each of the important HTTP headers, and then after the HTTP protocol activities are over the closure steps. Can I get that from net/http? -- "It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member
|
Next
|
Last
Pages: 1 2 Prev: Importing/exporting google contacts Next: Executing Password Change over Ruby Net-SSH |