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

  • Home
  • SEARCH
  • 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 9212861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:37:14+00:00 2026-06-18T01:37:14+00:00

If the HTTP response body for a curl request doesn’t contain a trailing newline,

  • 0

If the HTTP response body for a curl request doesn’t contain a trailing newline, I end up with this really annoying condition where the shell prompt is in the middle of the line, and escaping is messed up enough that when I put the last curl command on the screen, deleting characters from that curl command deletes the wrong characters.

For example:

[root@localhost ~]# curl jsonip.com
{"ip":"10.10.10.10","about":"/about"}[root@localhost ~]#

Is there a trick I can use to automatically add a newline at the end of a curl response, to get the prompt back on the left edge of the screen?

  • 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-18T01:37:16+00:00Added an answer on June 18, 2026 at 1:37 am

    From the man file:

    To better allow script programmers to get to know about the progress of
    curl, the -w/–write-out option was introduced. Using this, you can specify
    what information from the previous transfer you want to extract.

    To display the amount of bytes downloaded together with some text and an
    ending newline:

    curl -w 'We downloaded %{size_download} bytes\n' www.download.com
    

    So try adding the following to your ~/.curlrc file:

    -w "\n"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to pass (via string content of a HTTP request/response body) name value
How do I capture HTTP response when the request is made by web browser?
At the moment I am trying to HTTP response request in my Sharepoint WarmUp
What is the best way to view the HTTP response headers from a request
this is part of my code which reads an http response. It's supposed to
The response body of HTTP requests using the native 'http' module, displays question mark
I'm trying to read the http-response by ajax request. As an echo-server I use
I want to make a post request in Scala to this API http://api.atinternet-solutions.com/toolbox/reporting.asmx I
I'm using CURL to send a SOAP request to Mondrian. This is the PHP
I'm calling a service from PHP using cURL, like this: $response = curl_exec($ch); and

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.