从国外网站抄来的代码

Delphi source:

http := TIdHttp.Create(nil);
http.HandleRedirects := True;//允许头转向
http.ReadTimeout := 5000;//请求超时设置
http.Request.ContentType := 'application/json';//设置内容类型为json
jsonToSend := TStringStream.Create('{"name":"Peter Pan"}');//创建一个包含JSON数据的变量
jsonToSend.Position := 0;//将流位置置为0
Memo1.Lines.Text := http.Post('http://www.website.com/test.php', jsonToSend);//用MEMO控件接收POST后的数据返回
jsonToSend.free; http.free;//用完记得释放

PHP source:

<?php
$value = json_decode($_POST);
var_dump($value);
?>

http://blog.sina.com.cn/s/blog_722bc92e0101i7gp.html

http://stackoverflow.com/questions/12175952/delphi-tidhttp-post-json

最新文章

  1. 【原创】js中input type=file的一些问题
  2. 在Excel中制作金字塔条形图
  3. QT QString 很全的使用 (转)
  4. centos6.5编译安装git
  5. [译]git init
  6. Caffe学习系列(9):solver优化方法
  7. 磁盘测试工具fio
  8. (转)Redis复制与可扩展集群搭建
  9. android与PC互传文件 adb push
  10. python多线程学习笔记(超详细)
  11. 一大波jQuery事件即将来袭!
  12. 消息队列一:为什么需要消息队列(MQ)?
  13. RB-Tree插入过程详解
  14. MySQL忘记密码后找回密码
  15. MySQL初识
  16. 多分类Logistics回归公式的梯度上升推导&amp;极大似然证明sigmoid函数的由来
  17. LeetCode(62):不同路径
  18. 记录一下ionic canvas图片,还有canvas里面的图片跨域的问题
  19. Centos 7 安装 PostgreSQL PGAdmin4
  20. jdk源码-&gt;集合-&gt;HashMap

热门文章

  1. H5C3动画
  2. Ubuntu中文乱码问题解决方案
  3. [FreeMind] 绘制思维时遇到的常见问题解决办法
  4. mongoDB(Linux)
  5. SpringMVC学习笔记:单例与并发问题
  6. javascript对象的属性,方法,prototype作用范围分析.
  7. 【Linux】Jenkins+Git源码管理(三)
  8. GUI的最终选择Tkinter模块练习篇
  9. Codeforces 1086 简要题解
  10. git常规命令