I’m trying to create record in db via json. The problem is that i don’t know how to compose http request in URL bar:
It should be something like:
http://localhost:3000/addnewpost.json?content=sometexthere
Or this is not correct?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not correct. Creating a record should be a POST command, not a GET. As such, the data content should go in the POST headers, not in the URL.
Are you sending this POST directly from Ruby? (if so, you’ll want to look at Net::HTTP or some other ruby HTTP client). Show us some code and we’ll help you improve it.