Skip to content

Curl code from postman doesn't work #186

@forenheith

Description

@forenheith

I created request at postman, tested it, all works fine, then I clicked on Code button at the right top corner, copied CURL code, and tried to use it in Windows Shell and got the errors

`At line:2 char:3

  • --header 'x-pr-tenantid: 2720F16E-1E5B-4AA5-93CB-6169E36B5C9E' \
  • ~
    Missing expression after unary operator '--'.
    At line:2 char:3
  • --header 'x-pr-tenantid: 2720F16E-1E5B-4AA5-93CB-6169E36B5C9E' \

Unexpected token 'header' in expression or statement.
At line:3 char:3

  • --header 'x-pr-apikey: <<>> ...
  • ~
    Missing expression after unary operator '--'.
    At line:3 char:3
  • --header 'x-pr-apikey: <<>> ...

Unexpected token 'header' in expression or statement.
At line:4 char:3

  • --header 'Authorization: Bearer <> ...
  • ~
    Missing expression after unary operator '--'.
    At line:4 char:3
  • --header 'Authorization: Bearer <> ...

Unexpected token 'header' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator`

Then I changed --header on -h and got the new ones

`Invoke-WebRequest : A positional parameter cannot be found that accepts argument '--request'.
At line:1 char:1

  • curl --location --request GET 'http://localhost:60513//sip/transactio ...
  •   + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
      + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    
    

-h : The term '-h' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:2 char:1

  • -h 'x-pr-tenantid: 2720F16E-1E5B-4AA5-93CB-6169E36B5C9E' \
  • ~~
    • CategoryInfo : ObjectNotFound: (-h:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

-h : The term '-h' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:3 char:1

  • -h 'x-pr-apikey: <<>> ...
  • ~~
    • CategoryInfo : ObjectNotFound: (-h:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

-h : The term '-h' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:4 char:1

  • -h 'Authorization: Bearer <> ...
  • ~~
    • CategoryInfo : ObjectNotFound: (-h:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException`

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