A curl GET (with parameters) is accepted by the server but fails when done with Soap UI NG Pro
We have a REST API that I have made Soap UI NG Pro tests for. Unfortunately they are mostly GET requests with parameters. I am aware of the philosophy for avoiding parameters but I have no choice - I'm the tester!
Our command runs fine in this form (I changed some of the characters to remove proprietary information)
$ curl -X GET -k --cert certs/client.crt --key certs/client.key -v -d'myname="myvalue"' 'https://xxx.xx.xx.xxx:xxxxx/a/path'
It made a verbose output, much snipped but in essence here is the info:
> GET /a/path HTTP/1.1
> User-Agent: curl/7.27.0
> Host: xxx.xx.xx.xxx:xxxxx
> Accept: */*
> Content-Length: 16
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 16 out of 16 bytes
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Content-Type: application/json; charset=utf-8
< Content-Length: 101
< ETag: "611876272"
< Date: Fri, 21 Jul 2017 00:24:05 GMT
< Connection: keep-alive
<
So that works on the command line
Now the result of running the request with test runner is below, I get a error code 400 back from the server
Authorization: [Basic YWRtaW46cGFzc3dvcmQ=]
Connection: [Keep-Alive]
User-Agent: [Apache-HttpClient/4.5.2 (Java/1.8.0_111)]
Host: [xxx.xx.xx.xxx:xxxxx]
Accept-Encoding: [gzip,deflate]
GET https://xxx.xx.xx.xxx:xxxxx/a/path?myname="myvalue" HTTP/1.1
Accept-Encoding: gzip,deflate
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Host: xxx.xx.xx.xxx:xxxxx
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_111)
---------------- Response --------------------------
ETag: ["2124691785"]
Connection: [keep-alive]
#status#: [HTTP/1.1 400 Bad Request]
Content-Length: [141]
The request editor from the Ready! API Projects tab won't allow me to put a --data or -d for a curl data indicator in the section for name and value. I was exploring whether I needed to edit Content-Type and Content-Length for the headers and tried to force the length of the data or switch between application/json and application/x-www-form-urlencoded. I explored the requestFilter event handlers and noticed for my context and request interfaces when I do a "code completion" I am missing methods such as requestHeaders. I can only work with the request content but not set the headers.
So my options are running out.
I don't have the ability to change the REST API to use a POST with parameters - we don't want that.
Suggestions?