-
Prerequisites
Steps to reproduceI 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: error: Expected behaviorbody:
the body of the content should accept the json format and value "hello" inside the body should consider as stringActual behaviorbody:
the body of the content inside the json value is not accepting as stringError detailserror:
{
"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 dataNAVisualsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
|
As mentioned at the
|
Beta Was this translation helpful? Give feedback.
-
|
Below are the test i did with my powershell version 5.1. But all suggested solutions are not working as expected. Trying use the a string('hello') inside the body of the json in SELECT statement but the powershell is not considering as string. @iRon7 Need your thoughts or assistance on this issue. test 1: Error: test 2: Invoke-Expression : At line:2 char:45 test 3: Invoke-Expression : At line:2 char:47 test 4:
curl: (3) URL rejected: Bad hostname |
Beta Was this translation helpful? Give feedback.
-
|
As suggested before: please move your question with details to: https://stackoverflow.com/questions/ask
|
Beta Was this translation helpful? Give feedback.
-
|
Just a quick pointer: |
Beta Was this translation helpful? Give feedback.
-
|
@mklement0 still getting error for below command which you suggested.
Error:
|
Beta Was this translation helpful? Give feedback.
-
|
You need at least one space before the first Again, please note that this is not the place for PowerShell 5.1 questions. |
Beta Was this translation helpful? Give feedback.
-
|
This works fine. Thanks a lot for your help. Giving spaces before " gives the correct body structure. @mklement0 Thanks for all your help below is my body
|
Beta Was this translation helpful? Give feedback.
-
|
Glad to hear it's resolved, @rsarvan88; my pleasure. |
Beta Was this translation helpful? Give feedback.
This works fine. Thanks a lot for your help. Giving spaces before " gives the correct body structure. @mklement0 Thanks for all your help
below is my body
-d '{ \"statement\" : \"SELECT ''hello''\" }'