Main Content

matlab.net.http.Responsemessage类

包裹:matlab.net.http
超类:matlab.net.http.Message

HTTP响应消息

描述

回应类格式的HTTP响应消息由服务器返回。

类属性

密封
true

有关类属性的信息,请参阅类属性

创建

requestMessage。send方法创建响应消息。

特性

展开全部

服务器的状态线,指定为matlab.net.http.StatusLine目的。

属性:

GetAccess
public
setAccess
public
依赖
true

HTTP状态代码,指定为matlab.net.http.StatusCode目的。如同thestatusline.statuscode财产。

属性:

GetAccess
public
setAccess
不变
依赖
true

消息头,,,,specified as amatlab.net.http.headerfield对象或向量Headerfield对象。当您设置标题财产,Matlab®检查标头的字段,以确保它们适合消息类型。这requestMessagesendand完全的方法填写任何必需的标头字段,以适当形成的请求。

属性:

GetAccess
public
setAccess
public

Message body, specified as amatlab.net.http.messagebody目的,,,,matlab.net.http.io.ContentProvider,或可以接受的数据邮件正文constructor. By default,Body是空的(设置为[])。包含一个的请求消息Body属性通常使用诸如'PUT'or'邮政',不是默认值'得到',,,,but this convention is not enforced.

在完成或接收的消息中,如果该消息有一个ContentTypefieldheader field, then theMessageBody.ContentType属性设置为该值。否则,内容类型不变或空。

属性:

GetAccess
public
setAccess
public

消息是否完成,指定为trueor错误的。一个true价值意味着消息已完成。返回消息设置的方法Completed财产为true什么时候:

  • BodyorBody.Data属性是空的。

  • body.payload属性包含原始数据。

属性:

GetAccess
public
setAccess
public
短暂的
true

数据类型:逻辑

Methods

展开全部

例子

全部收缩

Send a message to the Hubble Heritage website requesting an image of Jupiter.

格式一个HTTP请求消息并显示反对tent-Type of the response message body. The server returns a JPEG image.

request = matlab.net.http.RequestMessage; uri = matlab.net.URI('http://heritage.stsci.edu/2007/14/images/p0714aa.jpg');r = send(请求,uri);R.Body.ContentType
ans =带有属性的介体:类型:“ image” subtype:“ jpeg”参数:[] mediainfo:“ image/jpeg” strige:[]

使用图像显示图像Imshowfunction. MATLAB resizes the image to fit on the screen.

warning('离开',,,,'图像:Initsize:AcustingMag');Imshow(R.Body.Data)

在R2016b中引入