Página 1 de 1

Web service

Publicado: Jue Ago 26, 2021 11:25 pm
por cfuentes
Hi Dear, I'm working on a web service, but when I send the POST it's redirected to an unwanted site and I want to redirect it, make a Redirect or a follow redirect to False and I have not been successful. Does anyone know how to set the False Redirect option True or False? Any recommendation, please.

Thanks in advance, below the code used:

cProducts += ']'
cBody := '{"products":' + cProducts + ','
cBody += '"external_verifications":[{"type":"NATIONAL_IDENTITY_CARD","value":"' + '' + aResponseText["patient_document_number"] + '"}], "currency_code":"DOP"}'
cWebService := "https://sandbox.osigu.com/dispensing/v1/documents/"
cWebService += ::oPreautoriza:Value + "/dispensations"
oHttp := CreateObject( "WinHTTP.WinHttpRequest.5.1" )
//oHttp := CreateObject( "MSXML2.XMLHTTP" )
oHttp:open( "POST", cWebService, .F.)
oHttp:SetRequestHeader("Accept", "application/json")
oHttp:SetRequestHeader("content-type","application/json")
oHttp:SetRequestHeader("authorization", &cToken)

oHttp:Option(6, .F.) // Aqui trato de hacer el Redirect, pero no me funciona

oHttp:send( cBody ) //Buscar como obtener la respuesta del reclamo generado, antes de consumir el location.
oHttp:WaitForResponse()
cResponseText := oHttp:getResponseHeader('Location')


Carlos Fuentes