PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → HTTPSendForm () Function Execution failed with the httpDelete method.
HTTPSendForm () Function Execution failed with the httpDelete method.
Iniciado por vinicius, 01,dic. 2017 19:21 - No hay respuesta
Publicado el 01,diciembre 2017 - 19:21
Folks,

I'm trying to run the HTTPSendForm () function for the httpDelete method, but it is returning Error 415 - Unsupported Media Type.

Follow Code below:

sAuthorization is string = EDT_Token_Type + "" + EDT_Access_Token

hEnviaRequest is httpRequest
hRecebeRequest is httpResponse
vResposta is Variant
sEndPoint is string
   
sEndPoint = "https://teste.com/purchases/100"

hEnviaRequest..URL = sEndPoint
hEnviaRequest..Method = httpDelete
hEnviaRequest..ContentType = "application / x-www-form-urlencoded"
hEnviaRequest..Header ["Authorization"] = sAuthorization

HTTPCreateForm ("FORMD")
HTTPAddParameter ("FORMD", "storecode", "1")
HTTPAddParameter ("FORMD", "devicecode", "22")
HTTPAddParameter ("FORMD", "date", "2017-11-20")

hRecebeRequest = HTTPSendForm ("FORMD", hEnviaRequest)

IF NOT ErrorOccurred THEN

     IF hRecebeRequest..StatusCode <> 200 THEN
          Info ("Error:" + hRecebeRequest..StatusCode + "-
 "+ hRecebeRequest..DescriptionStatusCode)
     ELSE
           Info ("OK")
     END

ELSE
Error (ErrorInfo (errFullDetails))
END

HTTPCancelForm ("FORMD")

If anyone has a tip, please help us.

Vinicius Souza