POST JSON String With Basic Authentication [JavaScript/AJAX Code]

An example of posting JSON string with basic auth credentials. The user authentication credentials are automatically converted to the Base64 encoded string and passed to the server with Authorization: Basic [token] request header. In this POST JSON with a Basic Authentication header example, we request the ReqBin echo URL. JSON data is passed on the Content tab, and the authentication credentials are passed on the Authentication tab. The JavaScript/AJAX code was automatically generated for the POST JSON String Basic Authentication example.
Loading...