这是什么意思http请求正文? [英] What does it mean http request body?

查看:189
本文介绍了这是什么意思http请求正文?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在阅读有关POST的内容并获取方法此处有一个声明,如当使用post方法时它使用HTTP请求体,这意味着什么HTTP请求体。 HTTP身体数据是在紧接头后的HTTP事务消息中传输的数据字节,如果有的话(在HTTP / 0.9的情况下,不传输头)。

大多数HTTP请求都是GET请求而没有实体,但是,模拟带有实体的请求对于正确强调代理代码和测试各种处理这些请求的钩子是很重要的,大多数具有实体的HTTP请求使用POST或PUT请求方法。 >

消息正文



消息正文部分对于HTTP消息是可选的,但如果是可用,则它被用来携带与re关联的实体主体任务或回应。如果实体主体是关联的,那么通常Content-Type和Content-Length标题行指定关联主体的性质。



消息主体是一个携带实际HTTP请求的主体数据(包括表单数据和上传等)以及来自服务器的HTTP响应数据(包括文件,图像等)。以下是邮件正文的简单内容:

 < html> 
< body>
< h1> Hello,World!< / h1>
< / body>
< / html>

有关HTTP消息和主体的更多详细信息,请参阅 w3org链接


Upon reading stuffs about POST and get methods here there is a statement like " when used post method it uses HTTP request Body . What Does it mean " HTTP request body".?

解决方案

HTTP Body Data is the data bytes transmitted in an HTTP transaction message immediately following the headers if there is any (in the case of HTTP/0.9 no headers are transmitted).

Most HTTP requests are GET requests without bodies. However, simulating requests with bodies is important to properly stress the proxy code and to test various hooks working with such requests. Most HTTP requests with bodies use POST or PUT request method.

Message Body

The message body part is optional for an HTTP message but if it is available then it is used to carry the entity-body associated with the request or response. If entity body is associated then usually Content-Type and Content-Length headers lines specify the nature of the body associated.

A message body is the one which carries actual HTTP request data (including form data and uploaded etc.) and HTTP response data from the server ( including files, images etc). Following is a simple content of a message body:

<html>
<body>
<h1>Hello, World!</h1>
</body>
</html>

For more details to HTTP messages and bodies refer to w3org link

这篇关于这是什么意思http请求正文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆