Passing JSON request starting with the character [ gives the error: invalid request format with GET operation [duplicate]

Your question is incomplete. Anyway I’ll give it a shot. Here is a test that works perfectly fine in Karate, cut and paste it into a new Scenario and see for yourself.

* url 'https://httpbin.org/post'
* request 
"""
[
  {
    "equipmentNumber": "76576",
    "systemIdentifier": "00045F063547",
    "serialNumber": "00098",
    "materialNumber": "786786"
  }
]
"""
* method post

Which results in this request:

1 > POST https://httpbin.org/post
1 > Accept-Encoding: gzip,deflate
1 > Connection: Keep-Alive
1 > Content-Length: 112
1 > Content-Type: application/json; charset=UTF-8
1 > Host: httpbin.org
1 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_231)
[{"equipmentNumber":"76576","systemIdentifier":"00045F063547","serialNumber":"00098","materialNumber":"786786"}]

So if you are still stuck, follow this process – else no one can help you with the lack of information in your question: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Leave a Comment

tech