I am using curl to hit a server through an http post request and sending xml as request body, using the following piece of code :
curl -X POST -d @path to xml file URL
Ex: curl -X POST -d @C:\docs\test.xml http://www.example.com
which successfully returns the json http response as follows :
"header": {
"product": "xxxxxxxxxx",
"version": "xxxxxxxx"
},
"status": {
"elapsedTime": 329,
"httpReturnCode": 200,
"statusCode": 0,
"success": true,
"startTime": 1350387905444,
"statusDescription": "Successful"
},
But this json response doesn't show the endTime timestamp, the time at which the webservice call returns.
I know a way from curl to find out the response time of a url, using command :
curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} n" http://www.google.com
The above command returns the response time in terms of milliseconds. Is there any way we can get the timestamp of http response using curl ? My requirement is to hit the server using http POST with a request body(XML file) and then get it response time in terms of timestamp. Any help is greatly appreciated.