Page 1 of 1

presenting parameters/values in another (clearer) way.

Posted: Sat Feb 03, 2018 4:54 pm
by teriibi
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 :? )

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

Posted: Sat Feb 03, 2018 5:22 pm
by matthiasr
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

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

Posted: Mon Feb 19, 2018 10:15 pm
by teriibi
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: