hWebService := CURL_EASY_INIT()
IF !EMPTY(hWebService)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_URL, "https://sandbox.gerencianet.com.br/v1/authorize")
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_RETURNTRANSFER, .T.)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_ENCODING, '')
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_MAXREDIRS, 10)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_TIMEOUT, 0)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_FOLLOWLOCATION, .T.)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_HTTP_VERSION, "CURL_HTTP_VERSION_1_1")
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_CUSTOMREQUEST, "POST")
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_POSTFIELDS, {"grant_type","client_credentials"})
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_HTTPHEADER, {'Authorization: Basic Q2...','Content-Type: application/json'})
ncurlErr:=curl_easy_perform (hWebService)
IF ncurlErr > 0
? "Curl Error: "+str(ncurlErr)
ENDIF
ENDIF
curl_easy_cleanup( hWebService )