Page 2 of 2

Re: How to post json with check_http

Posted: Tue Aug 18, 2015 11:32 pm
by jraj90
HI ssax,

I have tried posting using the output from both the websites you provided and the outcome is the same as before:-

Code: Select all

./check_http -H test.com -S -k 'Authorization: Bearer fdb6ffsdfdfseerwcxvxcvcvx' -u '/smsmessaging/v1/outbound/212830/requests' --method=POST --post='{\"outboundSMSMessageRequest\": {\"address\": [\"tel:+8801847149927\"],\"senderAddress\": \"tel:12345678\",\"outboundSMSTextMessage\": {\"message\": \"Hello World-jaya\"},\"clientCorrelator\": \"123456\",\"senderName\": \"ACME Inc.\"}}'

HTTP CRITICAL: HTTP/1.1 500 Internal Server Error - 1382 bytes in 0.476 second response time |time=0.476173s;;;0.000000 size=1382B;;;0

Code: Select all

./check_http -H test.com -S -k 'Authorization: Bearer fdb6ffsdfdfseerwcxvxcvcvx' -u '/smsmessaging/v1/outbound/212830/requests' --method=POST --post='%7B%22outboundSMSMessageRequest%22%3A%20%7B%22address%22%3A%20%5B%22tel%3A%2B8801847149927%22%5D%2C%22senderAddress%22%3A%20%22tel%3A12345678%22%2C%22outboundSMSTextMessage%22%3A%20%7B%22message%22%3A%20%22Hello%20World-jaya%22%7D%2C%22clientCorrelator%22%3A%20%22123456%22%2C%22senderName%22%3A%20%22ACME%20Inc.%22%7D%7D'

HTTP CRITICAL: HTTP/1.1 500 Internal Server Error - 1382 bytes in 0.554 second response time |time=0.553926s;;;0.000000 size=1382B;;;0

Thanks

Regards

Re: How to post json with check_http

Posted: Wed Aug 19, 2015 3:48 pm
by tmcdonald
When you run this command, can you also tail -f the Apache logs on the remote server to see what the 500 might be caused by?

Re: How to post json with check_http

Posted: Thu Aug 20, 2015 3:31 am
by jraj90
Hi guys,

Thank you for all the responses and help.

Finally I got it working by adding "-T 'application/json'" in the request.

Regards,
- Jaya -

Re: How to post json with check_http

Posted: Thu Aug 20, 2015 9:35 am
by tmcdonald
Glad to see it is working!

I'll be closing this thread now, but feel free to open another if you need anything in the future!