|
| How to Create, Update, and delete information via HttpRequest |
| Iniciado por guest, 22,oct. 2015 12:05 - 5 respuestas |
| |
| | | |
|
| |
| Publicado el 22,octubre 2015 - 12:05 |
Hi All,
Using Httprequest for displaying the all/specific information, 100% working properly. Now, I had an difficulty on how I can create, update and delete the information using httprequest from windev?
Please I need your advice and help.
Thanks, Ech |
| |
| |
| | | |
|
| | |
| |
| Publicado el 22,octubre 2015 - 12:46 |
Hello Ech,
there is a fully working example in WXReplication. However the gist is very simple : - in your httprequest, one parameter should be the ACTION (read/delete/edit, etc) - other parameters should contain the values (by example for an edit, File, key, valueofKey, fieldtochange, value to change, etc) - the code in the awp page read the first ACTION value and redirect...
How you organise that precisely is of course up to you. In WXReplication, I'm using an ini like structure in a string, then passing the string as a parameter. This allows me to be able to store multiple operations in a string and process them as a batch.
Depending on what you want to achieve, you may want to use a similar technique, as this allows to have a fixed number of parameters and any kind of processing after that
Best regards |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 102 mensajes |
|
| Publicado el 22,octubre 2015 - 14:23 |
Ech,
not shure if I know what you mean. Maybe HTTPGetResult is what you need:
http://doc.windev.com/en-US/…
Sebastian
-- http://arnoldconsult.de WinDev 20 with Oracle, WinDevMobile Android Apps and Motorola Windows CE Mobile Barcode Scanners, Python 3 with Oracle and MySQL |
| |
| |
| | | |
|
| | |
| |
| Publicado el 22,octubre 2015 - 15:35 |
Hi Fabrice/All,
Can you check the below codes: When I run this command to windev it gives me an error"le variant n'est pas un object".
ResStart is boolean _url is string = "http://192.168.2.51:8081/helpdesk/WebObjects/Helpdesk.woa/ra/Assets/…"; ResStart = HTTPRequest(_url) sJZon is ANSI string = HTTPGetResult()
jz is Variant jz=JSONToVariant(sJZon) Trace("Results:", jz.serialNumber)
But in browser, it works fine.
What is the problem for this code?
Regards, Alvin |
| |
| |
| | | |
|
| | |
| |
| Publicado el 22,octubre 2015 - 15:48 |
Hi All,
When I added:
ResStart is boolean _url is string = "http://192.168.2.51:8081/helpdesk/WebObjects/Helpdesk.woa/ra/Assets/…"; ResStart = HTTPRequest(_url) sJZon is ANSI string = HTTPGetResult() jz is Variant
sJZon = Replace(sJZon,"[", "{") sJZon = Replace(sJZon,"]", "}") sJZon = Replace(sJZon,Charact(13),"") jz=JSONToVariant(sJZon)
Trace("Results:", jz.serialNumber)
Then another error comes "Invalid JSON format"
Please advice.
Thanks, Ech |
| |
| |
| | | |
|
| | |
| |
| Publicado el 22,octubre 2015 - 16:05 |
Ech
json is a very sensitive syntax in wx, perhaps it's not mature enough for the parsing.
Why not paste some of results and have a look to see if I could help out, OK?
Cheers
King |
| |
| |
| | | |
|
| | | | |
| | |
|