Main Content

Call Web Services from MATLAB Using HTTP

Communicate with Web services using HTTP (Hypertext Transfer Protocol)

The MATLAB® RESTful web services functions webread, websave, webwrite, and the support function weboptions allow non-programmers to access many web services using HTTP GET and POST methods. For information about these functions, see Web Services.

However, some interactions with a web service are more complex and require functionality not supported by the RESTful web services functions. The MATLAB HTTP interface provides classes for writing web access applications. The interface includes classes for messages, their headers and fields, and other entities defined in The Internet Engineering Task Force (IETF®) standards. The interface contains functions that implement semantics of HTTP messaging and utilities for processing the data sent and received. It also contains support classes required to process, transmit, and receive messages.


expand all request message response message request or response message message type of HTTP message protocol version line of HTTP request message request method line of HTTP message class of HTTP response code in HTTP response line of HTTP response message field of HTTP message Accept header field WWW-Authenticate or Proxy-Authenticate header field Authentication-Info header field in response message Authorization or Proxy-Authorization header field Content-Disposition header field Content-Length field Content-Location header field Content-Type header field Cookie header field Date header field header field with any name and value to support parameterized syntax header field containing date class for HTTP header fields containing nonnegative integers Location header field class for HTTP Content-Type and Accept header fields Set-Cookie header field class for HTTP header fields containing URI components for HTTP message payloads for files in HTTP messages consumer for HTTP payloads consumer that converts JSON input into MATLAB data for image data in HTTP payloads for multipart content types in HTTP messages for binary data in HTTP messages for multiple content types in HTTP messages for HTTP message payloads to send files that sends form data to send multipart/form-data messages to send MATLAB strings to send MATLAB data as JSON string to send MATLAB image data to send multipart/mixed HTTP messages ContentProvider for HTTP payloads Authentication scheme or authorization information in HTTP messages cookie received from server cookie information for authenticating HTTP requests in HTTP log record thrown by HTTP services controlling HTTP message exchange history log record media type used in HTTP headers monitor for HTTP message exchange resource identifier (URI) arrays in HTTP queries in query portion of uniform resource identifier (URI)

Functions 64 decoding of string 64 encoding of byte string or vector

Namespaces of namespaces and classes in MATLAB HTTP interface of header field classes in MATLAB HTTP interface content consumers and providers for HTTP messages