Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

[WD21]HTTP Requests (no replies)

$
0
0
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 [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 [api.cyclopsit.com] in a browser you will see that the details for 2 agents are returned.

In Windev I tried this:

asURL is ANSI string = "[api.CyclopsIT.com];
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 [api.cyclopsit.com] 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 = "[api.CyclopsIT.com];
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

Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>