I have two app in rails that communicate between net/http:
In the first app controller is something like so:
class WebservicesController ApplicationController
require 'net/http'
require uri
layout 'admin'
def ws
uri = URI(http://localhost:3001/api/ws;)
I'm looking at the documentation:
http://ruby-doc.org/stdlib-2.0/libdoc/net/http/rdoc/Net/HTTP.html
And I notice two uses of Net::HTTP. Both are using GET requests. But
what's the difference? When to use which?
Net::HTTP.start(uri.host, uri.port) do |http|
request = Net::HTTP::Get.new uri
On Tue, May 7, 2013 at 12:43 PM, John Merlino stoici...@aol.com wrote:
I'm looking at the documentation:
http://ruby-doc.org/stdlib-2.0/libdoc/net/http/rdoc/Net/HTTP.html
And I notice two uses of Net::HTTP. Both are using GET requests. But
what's the difference? When to use which?
Doing a check on a remote file url, using Net::HTTP, I get an 'end of
file reached'
here is the Ruby code (1.9.2) [env ; Rails3 , webrick ]
url = URI.parse(URI.escape(test_upload.videoUrl))
req = Net::HTTP::Head.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|
On Wed, Apr 27, 2011 at 6:11 PM, Erwin yves_duf...@mac.com wrote:
Doing a check on a remote file url, using Net::HTTP, I get an 'end of
file reached'
here is the Ruby code (1.9.2) [env ; Rails3 , webrick ]
url = URI.parse(URI.escape(test_upload.videoUrl))
req =
HI All,
i am new to ROR
i am writing Ruby code for calling API blogs
i have written ruby code for
creating a attachment xml by
require 'net/http'
require 'uri'
url = URI.parse('https://localhost:3000/api/attachment/create.xml')
req = Net::HTTP::Post.new(url.path)
req.basic_auth 'a', 'a'
I need to pull an image from a URL (I have permission) that is a .jpg.
I know I need to set the content-type to 'image/jpeg', but not sure
where to do that at.
result = Net::HTTP.get_response(URI.parse('http://
link_to_image.jpg') )
result.body = gives me encoded junk.
Looking for help on how
On Sun, Jun 6, 2010 at 5:40 PM, Kim kim.gri...@gmail.com wrote:
I need to pull an image from a URL (I have permission) that is a .jpg.
result = Net::HTTP.get_response(URI.parse('http://
link_to_image.jpg') )
result.body = gives me encoded junk.
No, it gives you what you asked for: a
Hi,
I'm having a problem with a simple post request. The issue is that the
receiving side fails to process the message because apparently the body
of the post message is not sent in a single packet together with the
headers. The body contains only xml.
I'm running webrick. The thing is that if I
Hi,
I'm doing this:
response = Net::HTTP.start(host).request_head('/')
To check a domain for its response. Now some of the domains checked
will not exist and thus produce the following error:
SocketError: getaddrinfo: Name or service not known
But I don't want my application to fail when
10 matches
Mail list logo