【问题标题】:idHttp post ListBox or StringList content in jsonidHttp 在 json 中发布 ListBox 或 StringList 内容
【发布时间】:2016-05-17 12:52:27
【问题描述】:

如何使用TIdHTTP 以JSON 格式发布TStringList 或TListBox 的内容?

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

列表框的内容如下所示:

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

【问题讨论】:

标签: json delphi indy http-request


【解决方案1】:

根据需要创建 JSON 数据(使用 Delphi's own JSON framework,或第三方 JSON 库,或仅编写自己的 JSON 代码)。然后将 JSON 数据存储在TStream 中,例如TStringStream 或TMemoryStream,然后将该流传递给TIdHTTP.Post()。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-30
    • 1970-01-01
    • 2016-01-26
    • 2014-01-18
    • 1970-01-01
    • 2013-08-27
    • 2017-11-15
    • 1970-01-01
    相关资源
    最近更新 更多