presenting parameters/values in another (clearer) way.

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
teriibi
Posts: 254
Joined: Mon Nov 13, 2017 3:49 pm
Location: Bolivia

presenting parameters/values in another (clearer) way.

Post by teriibi » Sat Feb 03, 2018 4:54 pm

Hi,

What is another way to write/present all my parameters/values in this 1rst line below ?

Code: Select all

put "name="&Oname & "&age=" &Oage & "&num=" &Onum into SentData
post Sentdata to url"http.....
Any possible para meter presentation in Column style ? :roll:
(I find it a bit too "hieroglyphic looking as for now :? )

matthiasr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 190
Joined: Sat Apr 08, 2006 7:55 am
Location: Lübbecke, Germany
Contact:

Re: presenting parameters/values in another (clearer) way.

Post by matthiasr » Sat Feb 03, 2018 5:22 pm

I am using libURLMultipartFormData to create the data which is posted to the server even if i do not post files or binary data.


This is the example from the docs:

Code: Select all

local tForm, tError, tUrl, tName, tMessage, tFile
put empty into tForm
put "http://www.someserver.com/cgi-bin/form.cgi" into tUrl
put "dave" into tName 
put "hello" into tMessage
put "<file>" & "C:/myfile.txt" into tFile
put libURLMultipartFormData \
 (tForm, "name", tName, "message", tMessage, "file", tFile) \
 into tError
if tError is not empty then
 answer tError
else
 set the httpHeaders to line 1 of tForm
 post line 2 to -1 of tForm to url tUrl
 ## check the result, etc., here
 set the httpHeaders to empty
end if

teriibi
Posts: 254
Joined: Mon Nov 13, 2017 3:49 pm
Location: Bolivia

SOLVED Re: presenting parameters/values in another (clearer) way.

Post by teriibi » Mon Feb 19, 2018 10:15 pm

Ok,

I ended up this way which seems to me a much easier way to present things especially with very very long strings:

Code: Select all

   put "id="& getid into togo
   put "&" after togo
   put "name="& getname after togo
   put "&" after togo
   
   post togo to url"https://www.myserver.com/getdata.php"
   
:wink:

Post Reply

Return to “Databases”