matlab.net.http.Message.show - Display or return formatted version of message - MATLAB (original) (raw)

Main Content

Class: matlab.net.http.Message
Namespace: matlab.net.http

Display or return formatted version of message

Syntax

Description

show([msg](#bu71fmq-1-msg)) displays the whole message in the Command Window, including the Header andBody properties. If Body contains binary data that cannot be converted to characters, then the method displays a message indicating the length of the data in bytes.

Use this syntax for diagnostics or debugging.

show([msg](#bu71fmq-1-msg),[maxlength](#bu71fmq-1-maxlength)) displays the first maxlength characters ofBody. If Body is longer thanmaxlength characters, then the method displays the total length of the data.

example

str = show(___) returns a string containing the information to be displayed, and can include any of the input arguments in previous syntaxes.

Input Arguments

expand all

Number of bytes, specified as an integer to convert.

Examples

expand all

Display the first 100 characters only of the body of a message from mathworks.com. MATLAB displays text indicating the total number of characters in the message body.

request = matlab.net.http.RequestMessage; uri = matlab.net.URI('https://www.mathworks.com'); r = send(request,uri); show(r,100)

HTTP/1.1 200 OK Date: Mon, 02 Oct 2017 12:55:05 GMT Server: Apache/2.2.15 (CentOS) Host-ID: wcxm4 X-Content-Type-Options: nosniff Last-Modified: Sun, 01 Oct 2017 16:57:27 GMT ETag: "f4b6" Accept-Ranges: bytes Cache-Control: max-age=14400 Expires: Mon, 02 Oct 2017 16:55:05 GMT Vary: Accept-Encoding Content-Encoding: gzip Content-Length: 9500 Content-Type: text/html; charset=UTF-8 Connection: close

Version History

Introduced in R2016b