<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr">Hi,</div><div dir="ltr"><br></div><div dir="ltr">it seems that you should just create the header by your self and add it before reguests. </div><div dir="ltr"><pre class="programlisting" style="-webkit-text-size-adjust: auto; white-space: pre; background-color: rgb(254, 254, 238); color: rgb(0, 0, 0); border: 1px solid rgb(153, 204, 204); padding-left: 15pt; caret-color: rgb(0, 0, 0);">rest_append_hf("Authorization: Basic <BASE64 of creds here>");</pre></div><div dir="ltr"><br></div><div dir="ltr"><span style="font-size: 16px; caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);">when making a request. In basic HTTP authentication, a request contains a header field in the form of </span><code style="font-size: 16px; margin: 0px; padding: 0.2em 0.5em; border: 1px solid rgb(200, 204, 209); font-family: Menlo, Consolas, "Liberation Mono", "Courier New", monospace; font-stretch: inherit; line-height: inherit; vertical-align: baseline; background-image: none; white-space: pre-wrap; caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);">Authorization: Basic <credentials></code><span style="font-size: 16px; caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);">, where credentials is the </span><a href="https://en.m.wikipedia.org/wiki/Base64" title="Base64" style="font-size: 16px; margin: 0px; padding: 0px; border: 0px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Helvetica, Arial, sans-serif; font-stretch: inherit; line-height: inherit; vertical-align: baseline; background-image: none; color: rgb(107, 75, 161); text-decoration: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);">Base64</a><span style="font-size: 16px; caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);"> encoding of ID and password joined by a single colon </span><code style="font-size: 16px; margin: 0px; padding: 0.2em 0.5em; border: 1px solid rgb(200, 204, 209); font-family: Menlo, Consolas, "Liberation Mono", "Courier New", monospace; font-stretch: inherit; line-height: inherit; vertical-align: baseline; background-image: none; white-space: pre-wrap; caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);">:</code><span style="font-size: 16px; caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);">.</span></div><div dir="ltr"><span style="font-size: 16px; caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);"><br></span></div><div dir="ltr"><span style="font-size: 16px; caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);"><br></span></div><div dir="ltr"><span style="font-size: 16px; caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);">Tomi</span></div><div dir="ltr"><br>On 24. Jan 2021, at 3.40, Alexander Perkins <alexanderhenryperkins@gmail.com> wrote:<br><br></div><div dir="ltr"><div dir="ltr">HI All. I need to consume a RESTful web service and pass that information to avp variables.  I was looking at the rest_client module, but cannot find how to authenticate using basic authentication.  Does anyone have suggestions?<br><div><br></div><div>Thank you,</div><div>Alex</div></div>
<span>_______________________________________________</span><br><span>Users mailing list</span><br><span>Users@lists.opensips.org</span><br><span>http://lists.opensips.org/cgi-bin/mailman/listinfo/users</span><br></div></body></html>