Welcome! Log In Create A New Profile

Advanced

HTTP request webservice

Posted by sambroed 
HTTP request webservice
April 01, 2023 11:08AM
Hello,

I try to intergrate a webservice, tryed al lot of things but wil not be work. Anyone an idea for me to recieve the userhash?


[documenter.getpostman.com]

surl is string = "[koskamp.vrooamgrossier.nl];
sSoftware is string = "general"
sUser is string = "xx"
sPassword is string = "xx"
sActie is string = "getUserHash"

HTTPRequest(surl,"","","{""UserName"":"""+NoSpace(sUser)+""", ""Password"":"""+NoSpace(sPassword)+""", ""action"":"""+NoSpace(sActie)+CR)

EDT_NoName1 = HTTPGetResult()


Thanks in advance,

Sammy
pao
Re: HTTP request webservice
April 03, 2023 11:40AM
It looks like you must use one FORM, try someting like:
HTTPCreateForm("FORM")
HTTPAddParameter("FORM", "action", urlencode(sActie))
HTTPAddParameter("FORM", "username", urlencode(sUser))
HTTPAddParameter("FORM", "password", urlencdoe(sPassword ))

HTTPSendForm("FORM",surl)

EDT_NoName1 = HTTPGetResult()

HTTPCancelForm("FORM")

Regards

Paulo Oliveira



Edited 2 time(s). Last edit at 04/03/2023 12:22PM by pao.
Re: HTTP request webservice
April 03, 2023 07:53PM
No you have to do it like this .It is very easy:
this is an example I use:

httpReq is httpRequest
httpReq..Password = thepassword
httpReq..User =the user

httpReq.URL = "["]; +gsThehost + "/caclulation/"+httpReq..User +"/"+ httpReq..Password
httpReq..ContentType = "text/xml"

httpReq..Content = payload
httpReq.Method = httpPost //httpget etc

You try to consulme something from sombodu else so it is problably httpget
Re: HTTP request webservice
May 19, 2023 08:29PM
Tried a lot of thing in Windev but without any result, as you see in the attach it works.
Someone any idea to make this work in Windev?

Thanks,
Sammy
Attachments:
open | download - Schermafbeelding 2023-05-19 202717.png (61.5 KB)
Re: HTTP request webservice
May 22, 2023 08:34AM
Found this which may lead you into something that works:
https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68081-httpsend/read.awp

Cheers

Peter
Re: HTTP request webservice
May 22, 2023 06:52PM
Hello,

Do it like this and it works!

// Post parameters
sPostParameter = StringBuild("username=%1&password=%2&action=%3", sUser, sPassword, "getUserHash")

// Request
IF HTTPRequest(sRequestUrl, "", "", sPostParameter) = True THEN
sResult = HTTPGetResult()
gsHash = XMLExtractString(sResult, "hash", 1)
ELSE
Error(ErrorInfo())
END
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: