In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Web service

Xailer English public forum
cfuentes
Mensajes: 30
Registrado: Mié May 13, 2020 6:45 pm

Web service

Mensaje 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
Responder