Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To develop interface from VFP to WS but not know how
Message
De
09/10/2020 13:54:45
 
 
À
09/10/2020 11:41:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Divers
Thread ID:
01676523
Message ID:
01676566
Vues:
33
J'aime (1)
>>>I guess I have advanced a little with this:
>>>
>>>
>>>loHTTP= CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")
>>>loHTTP.Open("POST", "https://api-test.mypartner.com/", .F.)
>>>loHTTP.Setrequestheader("Content-type", "application/x-www-form-urlencoded")
>>>loHTTP.Send("json=" + m.lcJsonString)
>>>
>>>
>>>It returns me an html string which says:
>>>
>>>Server error
>>>405 - HTTP verb used to access this page is not allowed.
>>
>>Try with get instead of post. Also, try to add the "json=..." part to the url, as a parameter, urlencoded - as you announced when you asked for the header.

>
>The code that I showed. Was almost a copy/paste (except for the urls and data) code that I used in another interface I developed some months ago and is still working flawlessly, thanks to Antonio Lopes.
>
>I'll tried your suggestion. But yet I can't send the json. I used POST because in the documentation (which I showed in my first post) at the "Endpoint" description, it says:
>
>POST /wcf-services/service-customs.svc/customs/insert_customs_data
>
>Altought is not referring to the main URL but a path. I tried to POST to /wcf-services/service-customs.svc/customs/insert_customs_data but VFP gave me an error.
>
>It looks like it's something simple but I can't imagine it.
>
>Thanks anyway.
>

Luis, you're posting to the wrong address. I would imagine it would be something like
loHTTP.Open("POST","https://api-test.mypartner.com/wcf-services/service-customs.svc/customs/insert_customs_data",.f.)
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform