Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4606884
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:37:35+00:00 2026-05-22T00:37:35+00:00

I am testing a remote messaging service and I believe I am in need

  • 0

I am testing a remote messaging service and I “believe” I am in need of disabling CSRF in jQuery for my initial remote test to be successful.

I have disabled CSRF in the Application Controller already.

If I send the POST through the application itself, the messaging works and I get the following output in my rails server log:

Started POST “/messages” for 127.0.0.1 at 2011-05-07 10:49:29 -0400
Processing by MessagesController#create as JS
Parameters: {“utf8″=>”✓”, “authenticity_token”=>”xxx”, “message”=>{“content”=>”damn”}, “commit”=>”Send”}
SQL (0.1ms) SELECT name
FROM sqlite_master
WHERE type = ‘table’ AND NOT name = ‘sqlite_sequence’

AREL (0.5ms) INSERT INTO “messages” (“content”, “created_at”, “updated_at”) VALUES (‘damn’, ‘2011-05-07 14:49:29.887582’, ‘2011-05-07 14:49:29.887582’)
Rendered messages/_message.html.erb (3.6ms)
Rendered messages/create.js.erb (8.2ms)
Completed 200 OK in 133ms (Views: 17.0ms | ActiveRecord: 0.6ms)

If I send the following POST command via cURL, I get this output:

    curl -X POST -d 'message={"content":"lololol", "commit":"Send"}' http://localhost:3000/messages

Started POST “/messages” for 127.0.0.1 at 2011-05-07 10:54:15 -0400
Processing by MessagesController#create as
Parameters: {“message”=>”{\”content\”:\”lololol\”, \”commit\”:\”Send\”}”}
AREL (0.3ms) INSERT INTO “messages” (“content”, “created_at”, “updated_at”) VALUES (NULL, ‘2011-05-07 14:54:15.934156’, ‘2011-05-07 14:54:15.934156’)
Rendered messages/_message.html.erb (0.5ms)
Rendered messages/create.js.erb (4.2ms)
Completed 200 OK in 309ms (Views: 28.1ms | ActiveRecord: 0.3ms)

I can see a blank entry on my page with a timestamp of when I run the cURL command and a record is being created in the database with everything but the content.

Is it safe to assume the reason for this is due to the CSRF in jQuery not allowing the content to get published? If so, how do I disable it? Or am POSTing it wrong with cURL? or a mixture of both?

Thank you in advance for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:37:36+00:00Added an answer on May 22, 2026 at 12:37 am

    Your POST is wrong. The right syntax is:

    curl -X POST -d 'message[content]=lololol&commit=Send' http://localhost:3000/messages
    

    CSRF protection wouldn’t change the params. By default, when CSRF verification fails, Rails only resets the session (see the source of handle_unverified_request).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a remote Ubuntu Linux for testing a Ruby on Rails application. I
I'm testing my application as grails run-app. I have read How to remove app
I have a local database used for development and testing purpose and one remote
I'm using git for my workflow and I have a remote testing server. What
I have an issue with my simple testing code. Everything was fine on remote
I have a remote bare repository with two branches 'master' and 'testing', where HEAD
I have two remote branches in git, master and test . master reflects whatever
I'm using WCF to connect to a remote web service (asmx) for testing at
My Blackberry Webworks application is having problem opening a remote page when testing it
I'm testing a ClickOnce application deployment. I have setup a virtual directory on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.