FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
[WD21]HTTP Reqeusts
[WD21]HTTP Reqeusts
Débuté par Ericus, 03 oct. 2017 10:55 - 1 réponse
Connectez-vous…
Ericus
#1
Posté le 03 octobre 2017 - 10:55
Morning
I am now trying to get HTTPRequest or HTTPForm to work but with no avail. Fabrice I have had a look at your use of HTTPRequest in replication but I am not coming right.
If anybody cares to go to
http://api.cyclopsit.com/
you will see that there are 3 calls exposed.
1. List all the agents
2. Get specific agent details
3. Update agent details
1. If you type
http://api.cyclopsit.com/1.0/Client/List/1
in a browser you will see that the details for 2 agents are returned.
In Windev I tried this:
asURL is ANSI string = "
http://api.CyclopsIT.com/1.0/Client/List/1
"
asHeader is ANSI string
sUsResult is UNICODE string
IF NOT HTTPRequest(asURL,"","","","text/xml","","")
Error(ErrorInfo(errFullDetails))
ELSE
asHeader = HTTPGetResult(httpHeader)
END
Info(asHeader)
All that is returned is the OK and details about the server but no details of the 2 agents.
2. If you type in
http://api.cyclopsit.com/1.0/Client/Get/1/1
in a browser you will see that the details of one agent is returned.
In Windev I tried it now as follow:
asURL is ANSI string = "
http://api.CyclopsIT.com/1.0/Client/Get/
"
asHeader is ANSI string
sUsResult is UNICODE string
HTTPCreateForm("Form")
HTTPAddParameter("Form","agentId","1")
HTTPAddParameter("Form","clientId","1")
IF NOT HTTPSendForm("Form",asURL,"","","","text/xml") THEN
Error(ErrorInfo(errFullDetails))
END
asHeader = HTTPGetResult(httpHeader)
HTTPCancelForm("Form")
Info(asHeader)
Once again all I get is an OK with some server details but not usable data.
Can someone please tell me what I am doing wrong.
Thanks in advance
Ericus Steyn
Signaler
0
0
Luis Antonio Gutiérrez Flores
#2
Posté le 09 octobre 2017 - 22:15
Instead of doing the httpHeader in the HTTPGetResult, just do the HTTPGetResult()
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte