Page 1 of 1

httpHeaders Error

Posted: Wed Apr 04, 2018 6:35 pm
by ebenezereshun
Can someone guide me the appropriate way of sending the httpHeaders below. Am getting "Permission Denied" as responds from the server but all looks good with my code.

Code: Select all

 
put "ABCD" into clientId
put "1234" into clientSecret

put "Authorization: Basic" && base64Encode("clientId:clientSecret") && "Content-Type: application/json"&& "Cache-Control: no-cache"  into tHeader 
set the httpHeaders to tHeader

 post receiveMomoRequest to url "https://server/v1/merchantaccount/merchants/HMXXXXXX/receive"

Re: httpHeaders Error

Posted: Thu Apr 05, 2018 8:19 pm
by sphere
are you sure clientID: has to be base64 encoded too? and not just clientSecret ?
why does it has to be base64encoded ?

try putting the clientsecret into a variable first like:

Code: Select all

put "abracadabra" into tClientSecret
put "Authorization: Basic" && "clientId:" & base64Encode tClientSecret && "Content-Type: application/json"&& "Cache-Control: no-cache"  into tHeader 
set the httpHeaders to tHeader