I am trying to do a simple httpget request:
``parameters pcrequest
lohttp = createobject('wwHttp')
loHttp.AddPostKey(pcrequest)
lcresult = lohttp.httpget(lcurl,lcuser,lcpassword)``
and the requirement is that credentials are base64 encoded. What is the way to do that?
I was told to encrypt in the format "username:password"
John
Easy - it's built in:
lcValue = "1234ABC"
lcBase64 = STRCONVERT(lcValue,13)
But - if this is using Basic Authentication (which it looks like it is) the encoding happens automatically by the client when providing the credentials. IOW - don't encode the value yourself, WinInet will do that for you.
+++ Rick ---
Without trying to encode the credentials, I sent the message and I got a response which did not indicate anything about base64. The message sent and received are:
Sent: GET /api/v5/transactions?merchantId=ANV&clientSystemTransactionId=AC=21001WVD:CC=21010XZ
Received:
{"code":"4000340","details":{"message":"Type is required"}}
The fact that I got a response indicated to me that the credentials are ok.
The vendor said he tried my request on his side and it was successful and asked about the base64 encoding... maybe a red herring.