How can I post the content of a TStringList
or TListBox
in JSON
format using TIdHTTP
?
Note : I need to post them in one request !
The content of the list box looks like this :
window
door
box
pin
book
lamp
tree
house
roof
..
..
.
How can I post the content of a TStringList
or TListBox
in JSON
format using TIdHTTP
?
Note : I need to post them in one request !
The content of the list box looks like this :
window
door
box
pin
book
lamp
tree
house
roof
..
..
.
Create the JSON data however you want (use Delphi's own JSON framework, or a 3rd party JSON library, or just write your own JSON code). Then store the JSON data in a TStream
, such as TStringStream
or TMemoryStream
, and then pass that stream to TIdHTTP.Post()
.