Forum Discussion
john_124672
Nimbostratus
Feb 21, 2018irule sideband connection to make external POST call to a service
Hi, I am trying to send a POST request to service from an irule. irule will check for certain headers in the request, extract them and try to make a call out using a sideband connection. I was able t...
fstrada
Nimbostratus
Oct 02, 2019Hi John,
I found the same issue.
In my case the problem was the Content-Lenght and I resolved it in this way:
I have created a JSON string and I have counted the length of it
set json_data "\{ \"ipAddress\" : \"$client_ip\", \"userAgent\" : \"$user_browser\" \}"
set cnt_length [string length $json_data]
After that I have populated the POST request
set data "POST /test HTTP/1.1\r\nHost: www.test-acme.local\r\nAuthorization: Basic cGlwcG86cGx1dG8=\r\nContent-type: application/json\r\nContent-Length: $cnt_length\r\n\r\n$json_data"
set send_info [send -timeout 3000 -status send_status $conn $data]
I hope this help you.
Sorry for my terrible english
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects