httpHeaders Error

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ebenezereshun
Posts: 3
Joined: Sun Apr 01, 2018 8:51 am

httpHeaders Error

Post by ebenezereshun » Wed Apr 04, 2018 6:35 pm

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"

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: httpHeaders Error

Post by sphere » Thu Apr 05, 2018 8:19 pm

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

Post Reply

Return to “Internet”