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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:14:40+00:00 2026-06-04T14:14:40+00:00

How can I rewrite the following CURL command, so that it doesn’t use the

  • 0

How can I rewrite the following CURL command, so that it doesn’t use the -F option, but still generates the exact same HTTP request? i.e. so that it passes the multipart/form-data in the body directly.

curl -X POST -F example=test http://localhost:3000/test
  • 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-06-04T14:14:42+00:00Added an answer on June 4, 2026 at 2:14 pm

    Solved:

    curl \
      -X POST \
      -H "Content-Type: multipart/form-data; boundary=----------------------------4ebf00fbcf09" \
      --data-binary @test.txt \
      http://localhost:3000/test
    

    Where test.txt contains the following text, and most importantly has CRLF (\r\n) line endings:

    ------------------------------4ebf00fbcf09
    Content-Disposition: form-data; name="example"
    
    test
    ------------------------------4ebf00fbcf09--
    

    Notes: it is important to use --data-binary instead of plain old -d as the former preserves the line endings (which are very important). Also, note that the boundary in the body starts with an extra --.

    I’m going to repeat it because it’s so important, but that request-body file must have CRLF line endings. A multi-platform text editor with good line-ending support is jEdit (how to set the line endings in jEdit).

    If you’re interested in how I worked this out (debugging with a Ruby on Rails app) and not just the final solution, I wrote up my debugging steps on my blog.

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

Sidebar

Related Questions

How can I rewrite Apple's GLCameraRipple example so that it doesn't require iOS 5.0?
How I can rewrite following query that I will take minus Correction and Used
I'm using the following rewrite rule, but I can't get it to work: RewriteRule
How can I rewrite following clause: if u'января' in date_category['title']: month = 1 elif
How can I rewrite he following code using C#3.0 automatic properties? private int _myValue;
I want to rewrite the following code with the code below, but I am
I'm trying to use mod_rewrite to achieve the following rewrite: From - http:// pre.domain.com/public/?project=Awesome
How can I rewrite the following urls in CodeIgniter localhost/users/show_profile/john to localhost/john Thanks
How can I rewrite the following codeigniter url localhost/test_project/pages/show_page/11 to localhost/test_project/pages/11 and is it
I am trying to rewrite the following statement from Coffeescript to Javascript: d.data.name[0..1].toLowerCase() Can

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.