Has anyone used cURL in webdev? I'm trying to make requests by using restRequest and restResponse variables, but without success, the server is responding but it always says that my keys are wrong, which aren't, here is my code:
cMyRequest is restRequest
cMyRequest..URL = "[sandbox-api.openpay.mx]{merchant_ID}/charges"
cMyRequest..Content = "-u {private_key}"
cMyRequest..ContentType = typeMimeJSON
cMyRequest..Method = httpPost
cMyResponse is restResponse = RESTSend(cMyRequest)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info(cMyResponse..Content)
END
The documentation for cURL is as follows:
Authentication example
curl [sandbox-api.openpay.mx] \
-u sk_e568c42a6c384b7ab02cd47d2e407cab:
cMyRequest is restRequest
cMyRequest..URL = "[sandbox-api.openpay.mx]{merchant_ID}/charges"
cMyRequest..Content = "-u {private_key}"
cMyRequest..ContentType = typeMimeJSON
cMyRequest..Method = httpPost
cMyResponse is restResponse = RESTSend(cMyRequest)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info(cMyResponse..Content)
END
The documentation for cURL is as follows:
Authentication example
curl [sandbox-api.openpay.mx] \
-u sk_e568c42a6c384b7ab02cd47d2e407cab: