Main Content

使用 HTTP 从 MATLAB 调用 Web 服务

使用 HTTP(超文本传输协议)与 Web 服务通信

MATLAB® RESTful Web 服务函数 webreadwebsavewebwrite 和支持函数 weboptions 允许非编程人员使用 HTTP GET 和 POST 方法访问多个 Web 服务。有关这些函数的信息,请参阅Web 服务

但是,与 Web 服务的有些交互更为复杂,RESTful Web 服务函数并不支持进行此类交互所需的功能。MATLAB HTTP 接口提供用于编写 Web 访问应用程序的类。该接口包括用于消息、消息头和字段以及 The Internet Engineering Task Force (IETF®) 标准中定义的其他实体的类。该接口包含实现 HTTP 消息语义的函数以及用于处理发送和接收的数据的实用工具。它还包含处理、传送和接收消息所需的支持类。

全部展开

matlab.net.http.RequestMessageHTTP 请求方法
matlab.net.http.ResponseMessageHTTP 响应消息
matlab.net.http.MessageHTTP 请求或响应消息
matlab.net.http.MessageTypeHTTP 消息类型
matlab.net.http.MessageBodyHTTP 消息的主体
matlab.net.http.ProtocolVersionHTTP 协议版本
matlab.net.http.RequestLineHTTP 请求消息的第一行
matlab.net.http.RequestMethodHTTP 请求方法
matlab.net.http.StartLineHTTP 消息的第一行
matlab.net.http.StatusClassHTTP 响应的状态类
matlab.net.http.StatusCodeHTTP 响应中的状态代码
matlab.net.http.StatusLineHTTP 响应消息的第一行
matlab.net.http.HeaderFieldHTTP 消息的标头字段
matlab.net.http.field.AcceptFieldHTTP Accept 标头字段
matlab.net.http.field.AuthenticateFieldHTTP WWW-Authenticate 或 Proxy-Authenticate 标头字段
matlab.net.http.field.AuthenticationInfoField响应消息中的 HTTP Authentication-Info 标头字段
matlab.net.http.field.AuthorizationFieldHTTP Authorization 或 Proxy-Authorization 标头字段
matlab.net.http.field.ContentDispositionFieldHTTP Content-Disposition 标头字段
matlab.net.http.field.ContentLengthFieldHTTP Content-Length 字段
matlab.net.http.field.ContentLocationFieldHTTP Content-Location 标头字段
matlab.net.http.field.ContentTypeFieldHTTP Content-Type 标头字段
matlab.net.http.field.CookieFieldHTTP Cookie 标头字段
matlab.net.http.field.DateFieldHTTP Date 标头字段
matlab.net.http.field.GenericField具有任意名称和值的 HTTP 标头字段
matlab.net.http.field.GenericParameterizedField支持参数化语法的 GenericField
matlab.net.http.field.HTTPDateField包含日期的 HTTP 标头字段
matlab.net.http.field.IntegerField包含非负整数的 HTTP 标头字段的基类
matlab.net.http.field.LocationFieldHTTP Location 标头字段
matlab.net.http.field.MediaRangeFieldHTTP Content-Type 和 Accept 标头字段的基类
matlab.net.http.field.SetCookieFieldHTTP Set-Cookie 标头字段
matlab.net.http.field.URIReferenceField包含 URI 分量的 HTTP 标头字段的基类
matlab.net.http.io.ContentConsumerHTTP 消息有效负载的使用程序
matlab.net.http.io.FileConsumerHTTP 消息中的文件使用程序
matlab.net.http.io.StringConsumerHTTP 有效负载的字符串使用程序
matlab.net.http.io.JSONConsumer将 JSON 输入转换为 MATLAB 数据的内容使用程序
matlab.net.http.io.ImageConsumerHTTP 有效负载中的图像数据使用程序
matlab.net.http.io.MultipartConsumerHTTP 消息中的 Multipart 内容类型的辅助函数
matlab.net.http.io.BinaryConsumerHTTP 消息中的二进制数据的使用程序
matlab.net.http.io.GenericConsumerHTTP 消息中多种内容类型的使用程序
matlab.net.http.io.ContentProviderHTTP 消息有效负载的 ContentProvider
matlab.net.http.io.FileProvider用来发送文件的 ContentProvider
matlab.net.http.io.FormProvider发送表单数据的 ContentProvider
matlab.net.http.io.MultipartFormProvider发送 multipart/form-data 消息的 ContentProvider
matlab.net.http.io.StringProvider发送 MATLAB 字符串的 ContentProvider
matlab.net.http.io.JSONProviderMATLAB 数据作为 JSON 字符串发送的 ContentProvider
matlab.net.http.io.ImageProvider发送 MATLAB 图像数据的 ContentProvider
matlab.net.http.io.MultipartProvider发送 multipart/mixed HTTP 消息的 ContentProvider
matlab.net.http.io.GenericProviderHTTP 有效负载的通用 ContentProvider
matlab.net.http.AuthenticationSchemeHTTP 身份验证方案
matlab.net.http.AuthInfoHTTP 消息中的身份验证或授权信息
matlab.net.http.Cookie从服务器接收到的 HTTP Cookie
matlab.net.http.CookieInfoHTTP Cookie 信息
matlab.net.http.Credentials用于对 HTTP 请求进行身份验证的凭据
matlab.net.http.DispositionHTTP 日志记录中的结果
matlab.net.http.HTTPExceptionHTTP 服务引发的异常
matlab.net.http.HTTPOptions用来控制 HTTP 消息交换的选项
matlab.net.http.LogRecordHTTP 历史日志记录
matlab.net.http.MediaTypeHTTP 标头中使用的 Internet 媒体类型
matlab.net.http.ProgressMonitorHTTP 消息交换的进度监视器
matlab.net.URI统一资源标识符 (URI)
matlab.net.ArrayFormat转换 HTTP 查询中的数组
matlab.net.QueryParameter统一资源标识符 (URI) 的查询部分的参数

函数

matlab.net.base64decode字符串的 Base 64 解码
matlab.net.base64encode对字节字符串或向量进行 Base 64 编码

matlab.net.httpMATLAB HTTP 接口中的包和类汇总
matlab.net.http.fieldMATLAB HTTP 接口中的标头字段类摘要
matlab.net.http.ioHTTP 消息的流传输内容使用程序和提供程序

主题