idHTTP 向网站发送json格式数据

var
rbody:tstringstream;
begin
rbody:=tstringstream.Create('{"name":"lina"}') ;
IdHTTP1.Request.Accept := 'text/javascript';
IdHTTP1.Request.ContentType := 'application/json';
IdHTTP1.Request.ContentEncoding := 'utf-8'; memo1.Text:=idhttp1.Post('http://127.0.0.1/idhttpjson.php', RBody);
end;

发送普通格式

var
Param:TStringList;
begin
Param:=TStringList.Create;
Param.Add('name=lina');
memo1.Text:=IdHTTP1.Post('Http://127.0.0.1/idhttpjson.php', Param);
end;

https://bbs.csdn.net/topics/390551578

idHTTP 向网站发送json格式数据的更多相关文章

  1. 巧妙的使用jmeter来发送json格式数据

    1. header-manager 修改content-type值. 如果不修改该值, 则默认会是urlencode的数据格式(例如a=5&b=6). 修改为json后,会告诉服务器,发送的数 ...

  2. linux c 使用socket 发送http请求 可以发送json格式数据

    #include <stdio.h>#include <sys/socket.h>#include <sys/types.h>#include <time.h ...

  3. curl发送json格式数据

    php的curl方法详细的见官方手册. curl_setopt用法:  http://www.php.net/manual/en/function.curl-setopt.php <?php $ ...

  4. postman 发送json 格式数据

    hearder 设置 body 设置 { ", "primary_content": "{\"SN\":129,\"MPBH\&q ...

  5. 利用 CURL 发送JSON格式字符串

    /* * post 发送JSON 格式数据 * @param $url string URL * @param $data_string string 请求的具体内容 * @return array ...

  6. iOS-AFN Post JSON格式数据

    - (void)postRequest{ AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; // >>> ...

  7. 如何使用python内置的request发送JSON格式的数据

    使用步骤如下: 一.如果想发送json格式的数据,需要使用request模块中的Request类来创建对象,作为urlopen函数的参数 二.header中添加content-type为applica ...

  8. ajax发送json格式与文件数据、django自带的序列化器(了解)

    上期内容回顾 聚合查询和分组查询 # 聚合查询 max min sum avg count # 查询关键字:aggregate from django.db.models import Max, Mi ...

  9. 使用jQuery发送POST,Ajax请求返回JSON格式数据

    问题: 使用jQuery POST提交数据到PHP文件, PHP返回的json_encode后的数组数据,但jQuery接收到的数据不能解析为JSON对象,而是字符串{"code" ...

随机推荐

  1. 原生JS添加类名 删除类名

    为 <div> 元素添加 class: document.getElementById("myDIV").classList.add("mystyle&quo ...

  2. jQuery 自定义函数写法分享

    时间:02月20日   自定义主要通过两种方式实现$.extend({aa:function(){}});$.fn.extend({aa:function(){}});调用的方法分别是:$.aa(); ...

  3. 《OKR工作法》读书笔记(转)

    文章转自https://www.jianshu.com/p/c694363d5213

  4. Qt 打包发布程序

    利用Qt Creator写好程序,选择对应的编译器编译程序. 编译完成会在项目同级目录生成对应的目录来保存编译后的输出. 打包程序就要选择Qt自带的CMD工具,分别有下面几种. 比如,打包VS2017 ...

  5. PAT A1074 Reversing Linked List (25 分)——链表,vector,stl里的reverse

    Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elem ...

  6. PAT A1155 Heap Paths (30 分)——完全二叉树,层序遍历,特定dfs遍历

    In computer science, a heap is a specialized tree-based data structure that satisfies the heap prope ...

  7. django_redis作为 session backend 使用配置

    Django 默认可以使用任何 cache backend 作为 session backend, 将 django-redis 作为 session 储存后端不用安装任何额外的 backend # ...

  8. C# 语法二 值类型引用类型

    1.值类型 2.引用类型 一 值类型 值类型存放在栈中,引用类型存放在堆中. 值类型有:数值.布尔.字符,例如:int i;bool i2;char cr='a'; 二 引用类型 大多数类型是引用类型 ...

  9. 洛谷P1553 数字翻转(升级版)

    题目链接 https://www.luogu.org/problemnew/show/P1553 题目描述 给定一个数,请将该数各个位上数字反转得到一个新数. 这次与NOIp2011普及组第一题不同的 ...

  10. SQL Server中使用convert进行日期转换(转载)

    一般存入数据库中的时间格式为yyyy-mm-dd hh:mm:ss 如果要转换为yyyy-mm-dd  短日期格式.可以使用convert函数.下面是sqlserver帮助中关于convert函数的声 ...