<div dir="ltr">Hi all, <div><br></div><div>Is there a way to add extra headers with http_client_query() from http_client module?</div><div><br></div><div><div>In current http_query() from utils module, according to the doc, you can add a custom header:</div><div><br></div><div><div><i>4. Functions</i></div><div><i>4.1.  http_query(url, [post-data], [header-data], result)<br></i></div><div><i>...</i></div><div><i>If you want to add additional headers to the request, you have to define the “header”-data, that should be submitted in that request as the third parameter. If this parameter is empty, it is not set.<br></i></div><div><i>...</i></div></div></div><div><br></div><div>and I have that working with the following:</div><div><br></div><div><font face="monospace, monospace">http_query("<a href="https://example.com/api">https://example.com/api</a>", "param1=value1&param2=value2", "Cookie: apikey=super_secret_api_key", "$var(call_info)");</font><br></div><div><br></div><div><br></div><div>The problem is that http_query() is removed in Kamailio v5, and the http_client_query() only has the ability to add specifically the content-type header:</div><div><br></div><div><div><i>4. Functions</i></div><div><i>4.1.  http_connect(connection, url, [content_type, data,] result)<br></i></div><div><i>...</i></div><div><i>content_type - Used only when posting data with HTTP POST. An Internet Media type, like "application/json" or "text/plain". Will be added to the HTTP request as a header.<br></i></div><div><i>...</i></div></div><div><br></div><div><br></div><div>Is there another way to add a custom header to a http request with the http_client module?</div><div><br></div><div>Any workarounds for this?</div><div><br></div><div><br></div><div>Thanks, </div><div>Joel.</div><div><br></div><div><br></div></div>