2016-05-17 16 views
1

如何使用TIdHTTPJSON的格式发布TStringListTListBox的内容?idHttp json中的ListBox或StringList内容

注意:我需要在一个请求中发布它们!

列表框中的内容是这样的:

window 
door 
box 
pin 
book 
lamp 
tree 
house 
roof 
.. 
.. 
. 
+0

你知道如何用JSON格式化文本吗? – Zam

+0

http://stackoverflow.com/questions/301991/what-s-the-simplest-way-to-call-http-post-url-using-delphi Indy post example – Zam

+0

https://github.com/ onryldz/x-superobject是一个Delphi跨平台快速JSON库。使用方便 –

回答

0

创建JSON数据,但是你想(使用Delphi's own JSON framework,或第三方的JSON库,或只写你自己的JSON代码)。然后将JSON数据存储在TStream中,例如TStringStreamTMemoryStream,然后将该数据流传递给TIdHTTP.Post()