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 561243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:25:45+00:00 2026-05-13T12:25:45+00:00

thanks for reading this. I was wondering if I have some simple authentication system

  • 0

thanks for reading this.

I was wondering if I have some simple authentication system in place, like authlogic, how does one use curl to post and put data and, even before talking about posting and putting data, how does one “login” with curl and have the server remember or have curl remember that it is logged in?

if you were to choose, would you rather use XML or JSON to post data? And any advice on how to make this posting secure?

Thank You.

  • 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-13T12:25:46+00:00Added an answer on May 13, 2026 at 12:25 pm

    I think I got it

    So to add that artcile with title and body.

    1) login:

    curl -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST http://example.com/login -d "{\"user_session\" : { \"username\" : \"someuser\", \"password\" : \"somepassword\"}}" -c example_cook.txt
    

    Because I am using Rails, I have to use json or xml so to avoid the need for authenticity token. Then I save the cook in example_cook.txt for the next step

    curl -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST http://example.com/articles -d "{\"articles\" : { \"title\" : \"lorem\", \"body\" : \"ipsum\"}}" -b example_cook.txt
    

    calling the ‘-b example_cook.txt’ will tell curl to use that session information which the server needs for authenticating you.

    That’s it!

    Regards

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

Sidebar

Related Questions

Thanks for reading this. I am dynamically generating some data which includes a select
Thanks for reading this. I have markup similar to what is below. Using the
Thanks for reading this I thought I could use find(), but couldn't make it
Thanks in Advance for reading and answer this question. I got button in asp
I was wondering how difficult it would be to make an application like this.
I have been reading some of the books by Hoglund and I thought I
I've been doing some reading into designing template code have a question about it.
Thanks for reading this. I am using a shared service (server=sharedLib) when setting up
I have an asp repeater reading a datasource and it's linked eventually to this
Thanks for reading. I'm a bit new to jQuery, and am trying to make

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.