Forum Discussion
If you look at the both requests closely, two differences :
- Content-Type: application/x-www-form-urlencoded - you can change it in soapui to the same text as value.
- Accept-Encoding: [gzip,deflate] - is additional in your soapui request; but not in curl request. this can be changed in the preferences.
Try to address the above and see if that helps.
Still it is not working, but you made a good point! I got rid of that gzip / compressed part and Ready! API made me restart the tool.
I added a header "Accept: */*" and the "Content-Type: application/x-www-form-urlencoded" - the odd thing is that if I added the Content-Length: header and a value of number of bytes in the name/value string, the sending process would go on forever. The square next to the green "send" triangle would stay red.
So I wonder if that is a clue as to what is going on?
Here is my raw request that I tried sending from the Project tab:
GET https://xx.xx.xx.xxx:xxxxx/a/proprietarypath?myname="myvalue" HTTP/1.1
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Accept: */*
Content-Type: application/x-www-form-urlencoded
Host: xx.xx.xx.xxx:xxxxx
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_111)
It looks closer to what the curl sent but the curl provided the Content-Length.
curl -X GET -k --cert certs/client.crt --key certs/client.key -v -d'myname="myvalue"' 'https://xx.xx.xx.xxx:xxxxx/a/proprietarypath'
here is the summary from the -v
> GET /a/proprietarypath HTTP/1.1
> User-Agent: curl/7.27.0
> Host: xx.xx.xx.xxx:xxxxx
> Accept: */*
> Content-Length: nn
> Content-Type: application/x-www-form-urlencoded
>
And curl does not show the parameter name/value stuff.
I noticed I can get this google api to work
curl -X GET -k -v 'http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+view,+CA&sensor=false'
but I cannot get it to respond successfully when trying -d or --data!
curl -X GET -k -v 'http://maps.googleapis.com/maps/api/geocode/xml' -d'address=1600+Amphitheatre+Parkway,+Mountain+view,+CA&sensor=false'
- nmrao8 years ago
Champion Level 1
You do not have to send content-length which would be calculated based on the request. - Bill_In_Irvine8 years agoContributor
I tried to get rid of "Connection: Keep Alive" - but don't know how. I changed the User-Agent header
GET https://xx.xx.xx.xxx:xxxxx/a/proprietarypath?myname="myvalue" HTTP/1.1
User-Agent: curl/7.27.0
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Accept: */*
Content-Type: application/x-www-form-urlencoded
Host: xx.xx.xx.xxx:xxxxx
Connection: Keep-Aliveso that the differences are that the raw data from ReadyApi includes the parameters, it has the Keep-Alive too. The curl command verbose has content length.