知识点

本文是一个很另类的文章,在项目中用的比较少,但如果项目中真的出现了这种情况,我们也需要知道如何去解决,对于知识点StringContent和FormUrlEncodedContent我们应该了解的多一点,FormUrlEncodedContent是以键/值对的形式进行POST数据的提供,同时要求服务端以x-www-form-urlencoded的方式去接收数据!而StringContent是ByteArrayContent的一个子集,也是MultipartFormDataContent的一个子集,在进行大数据传输时,我们需要使用这种方法,如果传递的是字符串,可以采用StringContent,如果是二进制流,可以使用ByteArrayContent,而这两种方式都可以对外以MultipartFormDataContent的形式体现,而在服务端要以mutipart/form-data的方式来接收数据!

再深一点

multipart/form-data: 就是http请求中的multipart/form-data,它会将表单的数据处理为一条消息,以标签为单元,用分隔符分开。既可以上传键值对,也可以上传文件。当上传的字段是文件时,会有Content-Type来表名文件类型;content-disposition,用来说明字段的一些信息;由于有boundary(分隔符号)隔离,所以multipart/form-data既可以上传文件,也可以上传键值对,它采用了键值对的方式,所以可以上传多个文件。

x-www-form-urlencoded:会将表单数据转成键/值对进行传递,有大小的限制,一般是2M。

Raw:可以上传任何格式文本,你需要显示的说明content-type,如text/plain,text/html,text/json,text/xml等。

Binary:一般上传文件流,它相当于content-type为application/octet-stream的情况。

从上面的介绍不难发现,raw和binary方式都属于multipart/form-data,只不过是两种不同的体现而以。

DotNet平台为WebAPI传递大数据

对于普通方式的HttpClient(x-www-form-urlencoded)有时已经不能满足我们的需要了,所以必须上multipart/form-data,即在HttpClient构建时,采用StringContent的内容类型,下面是在客户端构建一个HttpClient的方式,以服务端(webapi restful)传递一个大大的JSON对象!

          var list = new List<TestApiModel>();

                entity.Category = new Category { Title = "北京" };
entity.OrderList = new List<OrderList>
{
new OrderList{Price=1,ProductName="tel",Address=new Address {Province="印度"}},
new OrderList{Price=100,ProductName="tv",Address=new Address {Province="日本"}},
new OrderList{Price=999,ProductName="pc",Address=new Address {Province="美国"}}
};
for (int i = 0; i <= 100; i++)
list.Add(entity); var handler = new HttpClientHandler()
{
AutomaticDecompression = System.Net.DecompressionMethods.GZip
};
using (var http = new HttpClient(handler))
{
var body = entity.ToNameValueCollection();
var content = new StringContent(list.ToJson(), Encoding.UTF8, "text/json");
var responseResult = http.PostAsync(UriAddress, content).Result;
}

如果客户端采用了这种StringContent的方式,那么在设计WebApi时只有两种选择,第一种就是使用JSON强类型(类对象)的参数,第二种就是不写参数(空),如果使用string类型的参数,那这个接口无法被找到,即出现的结果是404的状态码!下面看一下服务端的数据处理,也是很简单!

    public async Task<HttpResponseMessage> Post()//没有参数表示使用raw,form-data方式进行传输
{
try
{ var data =await Request.Content.ReadAsStringAsync();
var entity = Lind.DDD.Utils.SerializeMemoryHelper.DeserializeFromJson<IEnumerable<TestApiModel>>(data);
}
//....... }
 

上面代码从请求上下文中拿到了这个大数据的字符串,然后通过反序列化得到了下面的结果:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu8AAACsCAIAAABEstXtAAAgAElEQVR4nO2dLZPkuJaG+5ekedP9B82Mbwwp0GwWTphfcBc0LmK0GxcMu2CwwEYUGb4xoDbGZCsmYkjBKTcxSZAL5I9zjo5kyXZamen3CUVHtWx9HJcsvSXJOp/+57f/Q0BAQEBAQEC43/CpAwAAAAC4Z6BmwBFp2zZ3FQAAAGwG1Aw4IlAzAADwSEDNgCMCNQMAADfI77//vizhVdTMf/33/xb//q/i3//1X//9v4lJTVWUdXONSgEw4agZUxWV6f+1/y2KoSk2dVmwq6FUp4GIdpza2mcrMBFX56Yui9Pp5NTCViy+uCEf/f5ADqYqRKINe4DI+ic8VVY9U2mPLqZWNM1WlUxte+k0dSmtXd9CApeWNd1Oa1RDMd7flq/VpbSNUHvY/E1nv+7+VuUXlFqN+Hpe4+Xqvn379mXg27dvMfWgbKxmrI55en55fXt/fXt/en5J1DSBpwmhAzZDUTNl3XRNXdkmRl+2qeE5r6CbaraJ0nuSm/RcBZRSFtW5j4wsrqlLe9/4Q3SFTVWUJUu05WseWf/op0qrZyptZI6rFDNwo0qKdrWwcnHEt66eQAtZ2Xg8EqQsS1d4Fel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6k57ZXuuupvF8ZHJ2/yLzd7FaFA4A2JHr75tJVzPpu4DVLhsdCvCyYm5mnZrZYN+MoR89edY7fDM9NKapy7I2Y+WXjeuhBd+mLqNWmvx7g4bk4rEvMH83qzE3A0Aecn7TZHcBJ+oYCxMr2meRUDMgxKp9M40bGViPkCPxUMzSeFk7OnIPVxRtpNXHVJ4tJnTNJbCaRkr0PDoyFeJZWhoyVyWAknyt+de2Gj0PAHnIf95M4kkzFsN387ldIfoUEGJOzYgTX8Jqph8g+V5RNkyy85CcUqLj2UaPkWHwNfazHb6PNahmuqYuNQ037XJlqz2OjWzZha25DDd7jvBxjBD5yOSdqQp7abX517S6zxA9DwAZuNOzgGe7DPQpIETwvJk75QFMWMONmI+eB4A83K+a8R97hbOAwRzBs4DvlBsZznNxC+bjLGAAsnGnagaAVTyin6ZbGM4zcnDzATg6UDPgiDyimgEAgOMi1UwLAAAAAHBX/D856NwzrniXAAAAAABJRU5ErkJggg==" alt="" />

当然,对于非常友好的webapi来说,你完全可以在方法参数上显示的使用强类型,这种api框架会帮助我们进行序列化的操作,真的很友好!

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnIAAACvCAIAAAD2c6QaAAAXSUlEQVR4nO3dK5LcSL+H4VyHt2DkCS1iFtBwwkR8FtDgRJkMEzARM2ooYKRGHS7Y0WRQGVjAwKw+xxdhH3qADtAtL/9MpaqyLqp+n1DE9Mi6pCol/ZQpVUm1AAAgEXXpAgAAcDviYnVXbcrt/uCRAAC8DjGxuqs21e7wkQAAvBbzsXqKUN1vy2vO3ysvHgDgas3F6gm6f3fVRp9yvy03oz7M9GX1f++3ZVmWm81mU1ZV99/tXhzZr2I0LGlXbfqJx1Xtqs2Un/ttaayV3mwAwFLhWE0eqvttuTEbgmLLUI7VTbndD0m435ZdrLojfYvSM3QYq63dKYhbVgAAwkKxmjpUjbbhZGiuakvwxGrfwKx2rRarzkhjodqCxT7qsYkqd/zSaAUALOGPVanpt2CkLBBT+22pJ+AxsSq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mCC" alt="" />

这行list对象已经被架构进行了序列化操作

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfAAAAC5CAIAAABY7vqhAAASD0lEQVR4nO2dPbLbxhJG70rI3KlXwfhlWoBj7sBvBU4YPZcDZQ4UM3DVTbQBBXYVIpeqlDiU4QSJA76AIDj/PwSvpntwTnWpyLkAiG6BH4fgzHwvEwAAdMHLY7t9/78LQeiKcRybnwNBvGkg6MRWAkEnuo/nCDqKT8gPBJ3oPixB/2+cmF4vLT//9sf+h1/3P/z6829/lMj6x8vl/YfL9x8uX64PWheC6D5igv7+62Xm6+VdwzN8vVzs98JyYj/GtyEIM1xBv4QICroj5e9+ev39z79+//Ovdz+9LrKeeOGPuesyuwFBVEVA0D9cvlwuH1/vT9+/PuGFHrh033+9XD5bO777dLl8th742xCEEwWC/u8YE3RTyse//xn//ucq6C//+eXlP78g6ISo8AX9/VdDzZ8XD1+65o73c/tw+WJ00nlfEInwBP3f0Y14D/0q3Gbf/NpSJejLg+UL5sfXy8fl4+Rz+xoRfYQr6LZQ+n9arsZro6mk1tX7ad7yy6e55eFLN/gSiccE4USgh/5ikxX0WNQJ+qv7BuDCJZ4bAUGP3DT/eLF6x07P43v76p2v29f7ze7ApWt8QjifE87rmi8R7JXzviAS8YQe+nME/cPly62P42xAEE+J0h663f7j51l8oz30ZGNV0EMnVsaqH0VjUl71o6j7Q9Al8P4hiPVReg9dhqC//3p7zD10ojhWCfr1R9GglC+bxSJ29b/7dL8XyYVLPDECo1xe7bsft1Euzi2Xq5je1d8YO1gq6PW3XPxRLv42BOHE4+PQl8e1I9CvEbiHfuP6/vnxMz+KEs+M8Dh0U2qXW+pG4109l0v0c6aH/sClex8Lb5zG3Og8dU6VIIxYO1M08SeCEBXMFCW6D9ZyIbYSCDrRfSDoxFYCQSe6DwSd2Eog6ET38TJN0wgAAPp5sIcOoI5xHFufAsDbgqDDVkDQoXsQdNgKCDp0z1pBL5+L5BOckRTnfNzv9/vDaZimaTgd9rvdb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QPQg6bAUEHbpHo8HFtEzEuI9iZNgi5PAFHYMLDC5yL5jNuq9hi00MLu5ltgouaHg/CMQT9MgU0GrSa7mYslLbboPBBQYXOTQaXBhL4bgr6UgpKwgkJOgYXKgRdAwuStBpcDF/9XK+gQkqKwikUtDtJUEwuAisf4LBxXIaUpRHqcHF/H9vfzUVVFYQiCvoGFzYOa61esi8/+JrdWFw8Tw0GlzYC9xb70kEHaKMGFxgcIHBRZoWBhf+dyhnA4AAK3ro6wQdg4uiHJ3dnbJjcFGERoML54sSPXQoYtU99MFvxOAiXDoMLhqi0+Ai+FOGpLKCQHKCjsEFBhf1Wc8HlKI8imaKZqsmqKwgkOQ4dKV0kMIahKQvSHl0CToGF/A4yZmiShGiaK2QkH5fM0UBtNDjWi4SFK0hG08/AIIOW6FHQQewwOACAKAT6KHDVhjpoUPvIOiwFRB06B4EHbYCgg7dg8EFbAVf0DG4wOAi94LZrPsattjW4MKupaDh/SAQT9AjU0CrSa/lYspKbbsNBhcYXOTQaHARW4JDUFlBICFBT6zlUk5a0DG4qNosuj0GFyVoNLg426stmisZSSkrCKRS0O0lQTC4CKx/4nwaYXDRHo0GF8aNlvPRXpRHSllBIK6gY3Bh52isO+g2YnARzdo9pcZoNLgwPi2PJ9ZDh0JGDC4wuHh61s6Lt0ajwYUB66FDMSt66OsEHYOLohyd3Z2yY3BRhEaDiwVnwBCCDilW3UMf/EYMLsKlw+CiIRoNLu4f116JpZQVBJITdAwuMLioz3o+oBTlUTRTNFs1QWUFgSTHoSulgxTWICR9QcqjS9AxuIDHSc4UVYoQRWuFhPRlzRT9PxkgQQ0b6IqtAAAAAElFTkSuQmCC" alt="" />

通过本篇文章,让我们更清楚的认识到了POST请求的几种方式,以及他们与服务端(api)如何去结合,对于java,.net平台,这些方法都是同样适用的!

来自:https://www.cnblogs.com/lori/p/5919306.html

HttpClient系列~StringContent与FormUrlEncodedContent的更多相关文章

  1. WebApi系列~StringContent与FormUrlEncodedContent

    回到目录 知识点 本文是一个很另类的文章,在项目中用的比较少,但如果项目中真的出现了这种情况,我们也需要知道如何去解决,对于知识点StringContent和FormUrlEncodedContent ...

  2. WebApi系列~StringContent参数需要添加MetaType对象

    回到目录 对于api调用已经很多见了,在客户端去post一个请求到API服务端也是经常见到,但有时不注意,可能会引起一些问题,如为一个HttpContent参数进行赋值时,如果使用StringCont ...

  3. WebApi系列~目录

    回到占占推荐博客索引 写了这个系列的文章不少了,也应该为大家写个目录了,最近很刮了很多SOA的风,很多企业都将自己的系统进行分割,通常是按模块进行拆分,为这个模块提供统一的接口提供业务服务,这不紧可以 ...

  4. HttpClient异步请求Post传递Json

    HttpClient异步Post请求,HttpClient.PostAsync(String, HttpContent, CancellationToken),String为Post的Url,Http ...

  5. C# HttpClient 请求认证、数据传输笔记

    目录 一,授权认证 二,请求类型 三,数据传输 C# HttpClient 请求认证.数据传输笔记 一,授权认证 客户端请求服务器时,需要通过授权认证许可,方能获取服务器资源,目前比较常见的认证方式有 ...

  6. win10 uwp httpClient 登陆CSDN

    本文告诉大家如何模拟登陆csdn,这个方法可以用于模拟登陆其他网站. HttpClient 使用 Cookie 我们可以使用下面代码让 HttpClient 使用 Cookie ,有了这个才可以保存登 ...

  7. 小心 HttpClient 中的 FormUrlEncodeContent 的 bug

    小心 HttpClient 中的 FormUrlEncodeContent 的 bug Intro 最近发现活动室预约项目里的上传图片有时候会有问题,周末找时间测试了一下,发现小图片的上传没问题,大图 ...

  8. HttpClient 应用案例揭破应用Discuss论坛登录

    闲来无事,写了一个对discuss论坛登录的案例,初次上场按照以前的惯例没成功,见过抓包分析discuss论坛成功完成,废话不多说 直接上代码. 1:winform 做客户端,添加HttpClient ...

  9. 使用微服务架构思想,设计部署OAuth2.0授权认证框架

    1,授权认证与微服务架构 1.1,由不同团队合作引发的授权认证问题 去年的时候,公司开发一款新产品,但人手不够,将B/S系统的Web开发外包,外包团队使用Vue.js框架,调用我们的WebAPI,但是 ...

随机推荐

  1. 剑指offer 按之字型顺序打印二叉树

    题目描述 请实现一个函数按照之字形打印二叉树,即第一行按照从左到右的顺序打印,第二层按照从右至左的顺序打印,第三行按照从左到右的顺序打印,其他行以此类推.   使用两个栈进行存储,我们在打印某一行节点 ...

  2. [Codeforces] #603 (Div. 2) A-E题解

    [Codeforces]1263A Sweet Problem [Codeforces]1263B PIN Code [Codeforces]1263C Everyone is a Winner! [ ...

  3. Scala 线性化规则和 super 操作

    如果一个类有多个父类,且父类的有相同的函数 f,在子类和父类中调用 super.f 都是按从右到左的调用函数的顺序. 这个规则名为:Linearization Rules 如下的代码 trait Ba ...

  4. List<string>绑定到DataGridView控件

    问题 将一个简单的List<string>作为数据源绑定到 DataGridView myDataGridView.DataSource = myStringList; 但是只得到一个名为 ...

  5. 配置gem5-gpu docker版

    1 安装docker:wget -qO- https://get.docker.com/ | sh,启动服务:sudo service docker start 2 把非root用户添加到docker ...

  6. spring boot 接口service有多个实现类

    接口.java public interface DeService { } 接口实现类1.java @Service("ud")public class DeServiceImp ...

  7. P 1007 素数对猜想

    转跳点:

  8. UVA - 1451 Average (斜率优化)

    题意:由01组成的长度为n的子串,AT由0表示,GC由1表示,求一段长度大于等于L且GC率最高的子串的起始终止坐标,若GC率相同,取长度较小,若长度相同,取起始坐标最小. 分析: 1.一个子串(i+1 ...

  9. Kafka--生产者

    一个应用程序在很多情况下需要往Kafka写入消息:记录用户的活动(用于审计和分析),记录度量指标,保存日志消息,记录智能家电的信息,与其他应用程序进行异步通信,缓冲即将写入到数据库的数据,等等. 多样 ...

  10. 使用Nginx搭建Tomcat9集群,Redis实现Session共享

    使用Nginx搭建Tomcat9集群,Redis实现Session共享 1.tomcat准备 首先准备两个tomcat9 ,修改配置文件server.xml 如果在多个服务器上分别启动tomcat 则 ...