Displaying 20 results from an estimated 100000 matches similar to: "Net:HTTP.post returns an Array"
2013 May 07
2
Net::HTTP
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
response = http.request request # Net::HTTPResponse object
end
uri =
2009 Apr 07
0
Net:HTTP post (to rails) example?
Hi all,
I''ve got a little remote uploader app (written in Ruby Shoes) that
uses Mechanize to create a new object (I think mechanize works by
submitting an http form).
I''d like to take Mechanize out of the equation and do a straight HTTP
POST (authenticated).. but I''m having problems with how to manage the
fact that my object has 2 files in it ... what is the syntax for
2008 Apr 23
0
Upload a file using Net:HTTP multipart post or ActiveResource
Hi Guys,
I am trying to upload a file to a rails server using a ruby script.
http://pastie.org/185380
I verified the parameters of the Net:HTTP post request and they seem
to be right. However the recipient, mongre,l shows following message
in console and the parameters sent, the file data, is all corrupted.
oh and one very weird thing happened. the console running mongrel
looks like following
2006 May 23
0
FakeWeb test helper for Net::HTTP / open-uri web requests
Hey All,
I''ve posted the first release of FakeWeb, a little library to help
with all your http client testing needs. This helper makes it trivial
to setup an idempodent environment for you to test any web service
requests in your applications.
Available on RubyForge, http://rubyforge.org/projects/fakeweb/
== Overview
* Force Net::HTTP (and any dependent libraries, e.g. open-uri) to
2006 Sep 13
1
Net::HTTPResponse
Hello :) I have a problem with the Net::HTTP library...
The Net::HTTP library [1] uses a Net::HTTPResponse object for all it''s
responses from web servers. This class has many subclasses, such as
HTTPSuccess, HTTPRedirecttion, etc.
When obtaining a response, the library suggests to check what it is by testing
the class of the returned object - using case/when or kind_of? (which it does
2010 Jun 23
2
Purpose of "Status" header in HTTP responses?
Hi folks
On line #63 of unicorn/http_response.rb a "Status" header is written to the
socket. A comment in the code explains that some broken clients require this
header and unicorn generously accommodates them.
We?re having the opposite problem. One of our clients using Microsoft Windows
and ASP haven?t been able to connect to our HTTP API since we moved it to
unicorn from passenger.
2008 Feb 27
2
problem installing webOrb => Plugin not found: "http://themidnightcoders.net:8089/svn/weborb"
I''m trying to install weborb in my applications but it is not working
as you can see:
C:\RoR\mijnapplication>ruby script/plugin install http://themidnightcoders.net:8
089/svn/weborb --force to reinstall
+ ./README
+ ./Rakefile
+ ./init.rb
+ ./install.rb
+ ./lib/AC_OETags.js
+ ./lib/InfoService.rb
+ ./lib/data-management-config.xml
+ ./lib/example.html
+ ./lib/example.mxml
+
2007 Sep 07
3
how to pass an array through url_for.
hi , every one.
i just want to generate url from url_for method
like this:
url_for(:controller=>"users",:action=>"index",:names=>["aotianlong","ayowaya"])
i except it''s generate
users?names[]=aotianlong&names[]=ayowaya
but it''s generated :
users?names=aotianlong%2Fayowaya
any idiea ?
thank you .
2008 Apr 10
2
Testing an action behind HTTP Authentication
Greetings,
I''m writing an integration test and would like to make sure that, with
the correct credentials, I get the proper response. The problem is I
don''t know how to use the ''get'' method to attach the username and
password to the request.
For example, when using RSpec''s Story tests..
When("I request the user information for that
2008 Feb 28
2
random exception driving me crazy: SecurityError (Insecure: can't modify array)
Hi all, I''m running into a very strange but incredibly annoying
problem that I just can''t seem to solve.
The exception is occurring from a seemingly innocuous line in my code,
a simple ''logger.warn("some debug information")''. The backtrace
follows:
SecurityError (Insecure: can''t modify array)
2007 Feb 08
0
Problem w/ HTTP POST
Hi guys,
I am trying to do a HTTP POST request to a server with Net::HTTP. I am
able to post fine if I am just posting regular text, but I need to
send an image over to the server. The image now resides on my own
server. I have read that Net::HTTP does not support multipart/form-
data, but I can be wrong. Is there a way around this? I have no clue
what to do next. Can anyone help me? Thanks!
2006 Nov 30
0
Query string based on the selection in HTTP POST
I want to generate the query string based on the options selected. For
example
it could be www.test.com/search?id=1 or
www.test.com/search?id=1&zip=60008. How could I achieve this using
http::POST?
I tried the following, which didn''t work
url = "{''id'' => 1, ''zip'' => 60008}"
res =
2005 Aug 25
0
multiple refreshs clicks cause errors in WEBrick
Hi all
I am new to rails, so I hope it is not a trivial question...
I am using rails with webrick and MySql4.1 on win XP.
I enter a simple action (with a post method) which fetches some data from a ''users'' table and present it in a rhtml view.
Now when I press the refresh button quickly a few times I get in the command line window errors such as this:
[2005-08-25 17:08:55]
2006 Sep 21
0
Call to session[:somevalue] returns the error "Symbol as array index"
I hope you can help me with this
In a controller I make a call to session[:user_id] in order to retrieve
the value that has previously been assigned to the session object by a
login method.
The result is the error "Symbol as array index", so rails for some
reason just thinks session is any other array.
I have tried prefixing the call with @request so that it goes:
somevariable =
2007 Oct 09
1
returning from function within Array.each
function do_a_loop()
{
var fields = new Array(1,2,3,4);
fields.each(function(item))
{
if(item == 2){
return;
}
}
}
Im trying to do the following with prototype,
but I need to exit the do_a_loop() function not just the function
within each().
any ideas?
I was originally using a (for in) loop until we moved to using
prototype, now that we cannot use for in we have lost some
2008 Apr 11
2
issues on Net:HTTP
in cotroller:
@url=URI.parse(''http://google.com.sg/webhp'')
@res = Net::HTTP.get_response(@clarifyurl)
in view: <%=@res.body>
this page displayed as
301 Moved
The document has moved here
what''s wrong with my code, I want to get the correct reponse HTML
content from google.
--~--~---------~--~----~------------~-------~--~----~
You received this message
2006 Aug 31
0
Net::HTTP.new produces SystemStackError?
http = Net::HTTP.new(HOST, PORT)
When I try to create a new Net::HTTP object, I get a SystemStackError:
"stack level too deep". The trace shows a long list of
"/usr/lib/ruby/1.8/net/http.rb:333:in `newobj''", which when I look at
the code seems to say that Net::HTTP keeps calling its own newobj method
recursively, with some Proxy object involved? I''m not
2007 Jan 01
0
Net::HTTP.get_response with local files "file://..."
Hi,
In my application I fetch a webpage with Net::HTTP.get_response(url).
For creating a unit test I don''t want to be depended on an internet
connection. So I tried to give an url like that:
"file:///c:/mydir/mypage.html" (this url works in webbrower). But it
seems that this is not the right protocol for Net::HTTP. Is there any
possibility to use such
2007 Jun 10
0
UNICOM, Video Conferencing in Pakistan http://www.unicom.net.pk/
UNICOM, Video Conferencing in Pakistan
http://www.unicom.net.pk/
We at Unicom are pleased to inform you that we have expanded our
network of video conferencing studios in all major cities of Pakistan
including Karachi, Lahore, Peshawar, Islamabad, Rawalpindi, Quetta,
Hayderabad, Nawabshah, Muzafarabad, Sialkot and now in Faisalabad and
Gujrawala .
All of our studio are equipped with professional
2008 Apr 19
0
http://groups.google.co.il/group/rubyonrails-talk/post?hl=iw
Hi
I want to show product prices in many currencies
Is there a way to import Exchange rates automatically?
Thanks
ErezĀ
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe