Hey I am new to Httparty. I can fetch data but have problem posting using Httparty. Anyone who can suggest some good references for that? Thanks a bunch.
Asked
Active
Viewed 206 times
0
-
Please add more information to your question, including: What you tried; What happened; What you expected to happen; A sample of your relevant source code. As it is, there is not enough information to answer your question. – Greg Hewgill May 02 '12 at 04:23
-
Hey, thank you for replying. I first asked this : http://stackoverflow.com/questions/10406428/sending-form-data-to-remote-rails-application-using-httparty No replies back. So I thought maybe I should start readying from scratch. – Sara May 02 '12 at 22:30
1 Answers
1
There aren't a lot of references out there for HTTParty. Primarily, the readme and examples in their github repo. You could potentially go through their code to get a feel as well. Here's a quick example of a post using the HTTParty mixin:
class Emailer
include HTTParty
base_uri 'api.emailer.com'
def send(username, password, to, subject, body)
options = { username: username,
password: password,
to: to,
subject: subject,
body: body }
post('/send', options)
end
end
While your question was about HTTParty, and I've had to use that in the past, I've generally liked Typheous better. You may want to take a peek at that. I'm sure there are plenty of other HTTP Clients out there too. Those are the two I've worked with, and I've tended to prefer Typheous.

Christopher WJ Rueber
- 2,141
- 15
- 22
-
Thank you for the reply. The problem is I don't know how to read from a form. Anyways, I would also ty Typheous and see if I can post the data. – Sara May 02 '12 at 22:33
-
Hey Chris, I finally was able to post successfully using httparty. I mostly had problem on retrieval part in the server side controller which I found how to do that. – Sara May 06 '12 at 17:42