Skip to content

Powershell version 5.1 with curl command is not working as expected #25970

@rsarvan88

Description

@rsarvan88

Prerequisites

Steps to reproduce

I have been facing issue with curl command execution in powershell version 5.1 while the content of the body has a string inside json format. The string inside the body is not escaping. I would need your suggestion/resolution to handle this issue. Please refer the example below

example:
curl.exe -k -v -u username:password -X POST "https://localhost:18093/query/service" -H "Content-Type: application/json" -d '{"statement": "SELECT "hello""}'

error:
{
"requestID": "4389166e-40f7-4970-94b8-631b4a30f826",
"errors": [{"code":3080,"column":8,"line":1,"msg":"Ambiguous reference to field 'hello' (near line 1, column 8)."}],
"status": "fatal",
"metrics": {"elapsedTime": "2.320937ms","executionTime": "319.505µs","resultCount": 0,"resultSize": 0,"serviceLoad": 1,"errorCount": 1}
}

Expected behavior

body:
the body of the content should accept the json format and value "hello" inside the body should consider as string

Actual behavior

body:
the body of the content inside the json value is not accepting as string

Error details

error:
{
"requestID": "4389166e-40f7-4970-94b8-631b4a30f826",
"errors": [{"code":3080,"column":8,"line":1,"msg":"Ambiguous reference to field 'hello' (near line 1, column 8)."}],
"status": "fatal",
"metrics": {"elapsedTime": "2.320937ms","executionTime": "319.505µs","resultCount": 0,"resultSize": 0,"serviceLoad": 1,"errorCount": 1}
}

Environment data

NA

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions