Preciso consumir uma API de terceiros que utiliza URL HTTPS, no postman, funciona normalmente, no Protheus retorna a mensagem "403 Forbidden", alguém tem alguma dica?
/*
oRestClient := FWRest():New("https://apiempresa.com.br/")
cUrlPath := "ics-seguranca/v1/oauth2/tokenGerar"
403 Forbidden
oRestClient := FWRest():New("https://apiempresa.com.br/ics-seguranca/")
cUrlPath := "v1/oauth2/tokenGerar"
403 Forbidden
oRestClient := FWRest():New("https://apiempresa.com.br/ics-seguranca/v1/")
cUrlPath := "oauth2/tokenGerar"
403 Forbidden
*/
oRestClient := FWRest():New("https://apiempresa.com.br/ics-seguranca/v1/oauth2/")
cUrlPath := "tokenGerar"
// 403 Forbidden
// https://apiempresa.com.br/ics-seguranca/v1/oauth2/tokenGerar
jLogin := JSonObject():New()
jLogin["grant_type"] := "password"
jLogin["username"] := ::cCodUser //
jLogin["password"] := ::cCodPasw //
aadd(aHeadOut,'Content-Type: application/json' )
aadd(aHeadOut,'Cache-Control: no-cache')
aadd(aHeadOut,'Authorization: Basic SUNTOnRvdGFs')
cJson := jLogin:ToJson()
oRestClient:setPath(cUrlPost)
oRestClient:SetPostParams(EncodeUTF8(cJson))
If oRestClient:Post(aHeadOut)
cJsonRet := oRestClient:GetResult()
EndIf
cErro := oRestClient:GetLastError()