net-http Questions

3

Solved

require 'net/http' require 'rubygems' require 'json' url = URI.parse('http://www.xyxx/abc/pqr') resp = Net::HTTP.get_response(url) # get_response takes an URI object data = resp.body puts dat...
Arcboutant asked 15/4, 2013 at 6:32

2

Solved

I have this ruby file: require 'net/http' require 'json' require 'uri' #test data newAcctJson ='{ "type": "Credit Card", "nickname": "MoreTesting", "rewards": 2, "balance": 50 }' #creates ...
Gag asked 31/3, 2015 at 14:51

2

Solved

It seems like both of these gems perform very similar tasks. Can anyone give examples of where one gem would be more useful than the other? I don't have specific code that I'm referring to, I'm mor...
Tiercel asked 26/5, 2013 at 21:54

1

Solved

I have problem where I need to download, unzip, and then process line by line a very large CSV file. I think it's useful to give you an idea how large the file is: big_file.zip ~700mb big_file.cs...
Scholem asked 29/4, 2014 at 23:48

1

Solved

I have a page that sometimes loads in over a minute. Assume this is the expected behavior and wont change. In these cases, I get Net::ReadTimeout. Note that this is after navigating to a page by c...
Wenona asked 13/7, 2015 at 12:25

1

What does the OpenSSL::SSL::SSLErrorWaitReadable "read would block" mean? I am getting the error OpenSSL::SSL::SSLErrorWaitReadable with the message read would block. I think this is because of ti...
Dichromaticism asked 31/5, 2015 at 3:22

6

Solved

I just want to hit a server from inside of my Rails controller, but not wait for the response. Is this possible? (without launching other threads I can't do that for performance reasons)
Foredate asked 21/10, 2013 at 19:19

3

Solved

How does one properly check the response from Net::HTTP::Get (for example) for "success" (i.e., a 2xx return code)? The documentation seems to be sadly silent on this simple question. I have: re...
Conveyance asked 19/8, 2012 at 0:10

3

Solved

For example: require 'net/http' uri = URI('http://example.com/some_path?query=string') Net::HTTP.start(uri.host, uri.port) do |http| request = Net::HTTP::Get.new uri response = http.request re...
Bistre asked 25/6, 2013 at 14:17

2

How can I set a larger timeout in net/http? What I'm doing is this: rta = JSON.parse(Net::HTTP.get(URI(url))) I've tried: uri = URI(url) http = Net::HTTP.new(uri.host, uri.port) http.open_time...
Minnow asked 11/10, 2013 at 19:8

2

If I had to send a bunch of post parameters along an HTTP request, all with the same name, how do I construct the data object to post? Picture a form with some check boxes, they all have the same ...
Hypnotism asked 25/9, 2013 at 12:3

1

Solved

I am currently developing a Rails app in which I need to dynamically send XML request to an external web service. I've never done this before and I a bit lost. More precisely I need to send reques...
Chastise asked 30/7, 2013 at 16:15

1

Solved

I'm using Net::HTTP to make a HTTP request. I get the error "HTTP request path is empty", but I strongly feel that it is not. The code is below: REQUEST_IP = "localhost" REQUEST_PORT = "8081" REQU...
Bickel asked 15/4, 2013 at 15:3

1

Solved

I need to send data in JSON to another app which runs on the same computer. I send request like so (rails 3.2.13 ) data = { //some data hash } url = URI.parse('http://localhost:6379/api/plans') ...
Pendergrass asked 18/6, 2013 at 8:0

2

Solved

I'm building a small website for personal use to test an API my company makes. My boss wants a website where we can enter a website, request a form using GET or POST, and the number of times to sen...
Pl asked 27/3, 2013 at 20:10

2

I'm having a bit of truble with omniauth/openid. When trying to authenticate, I found this in my logs: OpenID::FetchingError: Error fetching https://www.google.com/accounts/o8/.well-known/host-me...
Angele asked 19/3, 2011 at 10:48

1

Solved

My apologies in advance if this is a noobish doubt: I want to use a proxy in my Ruby code to fetch a few web pages. And I want to be sneaky about it! So I am using Tor. I have Tor running, and I a...
Ob asked 12/11, 2012 at 23:50

1

Solved

I use OpenURI library. object = open("http://example.com") If http://example.com server code response is equals to 200 my program acts as I expected. But if http://example.com server response c...
Turnsole asked 9/11, 2012 at 10:13

1

Solved

I'm using ruby 1.9.3 and trying to use open-uri to get a url and try posting using Net:HTTP Im trying to use proxy authentication for both: Trying to do a POST request with net/http: require 'ne...
Staggard asked 6/4, 2012 at 11:48

1

Solved

I'm using net/http and json to geocode an address using google's Geocoding API. Here is where the error is being thrown: response = Net::HTTP.get_response(URI.parse(url)) result = JSON.parse(respo...
Fr asked 19/2, 2012 at 21:5

1

I'm trying to fetch a resource via SSL using Net::HTTP. Here is the relevant code fragment: req = Net::HTTP::Get.new(ContentURI.path) https = Net::HTTP.new(ContentURI.host, ContentURI.port) https....
Tay asked 24/1, 2012 at 17:11

1

Solved

I'm afraid I've not got much experience with posting documents (e.g. XML) over web-servers, so I apologise if my understanding of HTTP is lacking. I have a basic Mongrel web server set up in a rub...
Urtication asked 31/1, 2012 at 23:41

2

Solved

I need an application to block an HTTP request so I had to add a couple of lines of code, the only piece I couldn't figure out was the statement if uri.scheme == 'https'; http.use_ssl = true is the...
Ennis asked 17/10, 2011 at 20:4

1

Solved

This is the oddest thing. When I add the ; in set_form_data, value gets interpreted as value; on the server side. When I remove the ;, the value for 'dontescape' gets interpreted as file%3a%2f%2f%2...
Merkel asked 1/8, 2011 at 20:0

1

Solved

To do a Net::HTTP https request without the block form you can do this: ... http = Net::HTTP.new(url.host, url.port) http.use_ssl = true ... But is there a way to tell Net::HTTP to use https whe...
Condign asked 14/6, 2011 at 16:55

© 2022 - 2024 — McMap. All rights reserved.