Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
2
Erster Beitrag:
vor 2 Monaten, 1 Woche
Letzter Beitrag:
vor 2 Monaten
Beteiligte Autoren:
Luis Antonio Gutiérrez Flores, Ericus

[WD21]HTTP Requests

Startbeitrag von Ericus am 03.10.2017 08: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 client 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

Antworten:

Instead of doing the httpHeader in the HTTPGetResult, just do the HTTPGetResult()

von Luis Antonio Gutiérrez Flores - am 09.10.2017 20:15
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.