PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WB18 - WM19] Send data via HTTP
[WB18 - WM19] Send data via HTTP
Iniciado por guest, 01,dic. 2016 10:32 - 7 respuestas
Publicado el 01,diciembre 2016 - 10:32
Good Morning,

I have to send an http request from a WinDev Mobile application to a WebDev application.
The request contains:

a list of textual data records
a list of images linked to each record

How to send the request from WinDev Mobile and, above all, how to retrieve data from a WebDev page?

I could use functions like HTTPAddParameter(), HTTPAddFile() and HTTPSendForm() from the mobile application but the problem is that I have to read this request in WebDev.

I'm reading about PageParameter(paramBuffer) but doesn't seems the right way to do what I want.

What's the best way?
Publicado el 01,diciembre 2016 - 11:00
Hi,

I'm using httprequest() to send the request to a WB page. i.e.
The request can be anything that's up to you, like an simple string or a tab-separated string or a XML string.
There I use PageParameter() to analyze the info, build the result and finally use StringDisplay() to return that to WM.

Seen from WM it's more or less like running a procedure or function on the webserver.
No htttpaddparameter or httpsendform needed.

A simple example would be to send "GetProducts" and return the result as
1 TAB Volvo CR
2 TAB BMW CR
3 TAB Mercedes
etc
Publicado el 01,diciembre 2016 - 11:15
Hi Arie,

thanks alot for your answer, but what about the photos? How can I sent photo to WebDev page?
Publicado el 01,diciembre 2016 - 11:19
Hi HIS21,

You can encode these in base64 like you do with web services and decode it again on the WebDev side.
Functions Crypt/Uncrypt in WX.

Cheers,

Peter Holemans
Publicado el 01,diciembre 2016 - 11:22
Hi Perter,

thanks alot, I will try. Do you have an example to show me?
Publicado el 01,diciembre 2016 - 11:35
Hi HIS21,

I use fLoadBuffer to read the image data from the file on the mobile device and send it to the server with the "application/octet-stream" as the type of message.

For some reason I never did the base64 conversion (I think because I didn't know about it years ago....). Maybe this parameter will instruct WM/WB to do this at a lower level? I can't answer that but I send 100000+ photos without any error

I even send the photos in chunks of 250Kb to be able to show some progress on the mobile device. Server side these chunks are simply put to one piece and saved with fSaveBuffer
Publicado el 01,diciembre 2016 - 11:42
Thancks Aire,

have you got some spinnet of code to hcare with me?
Publicado el 01,diciembre 2016 - 12:02
Hi

if you want an example, or even the full system already working and ready for use, you can check out wxreplication on my web site.
It's open source, and it's able of doing a full or partial replication using just that system (and encrypting the data on top of it)

Best regards