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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:16:39+00:00 2026-06-11T13:16:39+00:00

My problem: Using the command line tool to curl my localhost server while sending

  • 0

My problem:
Using the command line tool to curl my localhost server while sending some data along with my POST request is not working.

What seems to be causing the error:
Imagine something like this

  1. curl -i -X POST -H 'Content-Type: application/json' -d '{"data1": "data goes here", "data2": "data2 goes here"}' http://localhost/path/to/api

Result of the returning data:

curl: (6) Could not resolve host: application; No data record of requested type
curl: (6) Could not resolve host: data goes here,; No data record of requested type
curl: (6) Could not resolve host: data2; No data record of requested type
curl: (3) [globbing] unmatched close brace/bracket at pos 16

After some searching I figured out that problem couldn’t be the syntax used for the request since it works on UNIX shells.

Are you possibly using Windows? That so looks like a completely broken shell
that doesn’t properly deal with single-quotes vs double-quotes.
I just tried that command line and it worked fine on my linux box.
http://curl.haxx.se/mail/archive-2011-03/0066.html

I tried to work around with those "M/kbd> escaping it " but it still didn’t work

2.

curl -i -X POST -H ‘Content-Type: application/json’ -d ‘{\"data1\": \"data goes here\", \"data2\": \"data2 goes here\"}’ http://localhost/path/to/api

curl -i -X POST -H ‘Content-Type: application/json’ -d ‘{\"data1\"\: \"data goes here\", \"data2\"\: \"data2 goes here\"}’ http://localhost/path/to/api

So I gave up.
Windows seems to messing up with the JSON object sent on POST.

  • 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-11T13:16:40+00:00Added an answer on June 11, 2026 at 1:16 pm

    I ran into the same issue on my win7 x64 laptop and was able to get it working using the curl release that is labeled Win64 – Generic w SSL by using the very similar command line format:

    C:\Projects\curl-7.23.1-win64-ssl-sspi>curl -H "Content-Type: application/json" -X POST http://localhost/someapi -d "{\"Name\":\"Test Value\"}"
    

    Which only differs from your 2nd escape version by using double-quotes around the escaped ones and the header parameter value. Definitely prefer the linux shell syntax more.

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

Sidebar

Related Questions

Using VC++ Command Line for the first time. Facing problem in setting proper paths
I am doing command line xcodebuild using a shell script. My problem is if
I ran into a problem using Springsource Tool Suite when writing some groovy scripts
I'm using the command line compiler for builds. One problem I see is that
I am trying to run a java based tool using a command line syntax
I'm having a problem using the sed substitution option that executes a command in
I'm trying to call an ImageMagick command from Python 2.7 using subprocess.call. My problem
I am using TIdHttpServer to process some commands the problem is that some commands
I've written a command line tool that preprocesses a number of files then compiles
I have been writing command-line Python scripts for a while, but recently I felt

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.