MySocket.SetRequestHeader(“Authorization”, "Basic " + EncodeBase64(tLogin.Text + “:” + tPass.Text))
Try http://user:firstname.lastname@example.org with a browser that you are not logged in to see if basic authentication works.
Or you try it with something like cocoa-rest-client/.
Thanks Marius for the Cocoa-rest-client ! very useful !
i just found my problem… i used an other port ! oups
You can also use the AuthenticationRequired event to pass the user/password.
I just wanted to add a little note because I was using this to figure out how to call the REST API for WooCommerce. I would recommend setting the line wrap to 0 to ensure the encode64 does not add a line break after 76 characters. I couldn’t figure out why I was getting a 400 bad request.
When I looked at the encoded key, I realized what was happening.
secureSite.SetRequestHeader(“Authorization:”, "Basic " + EncodeBase64( “userkey:userpassword”, 0))