Main Content

show

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

Display or return formatted version of message

Description

show(msg) displays the whole message in the Command Window, including the Header and Body 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,maxlength) displays the first maxlength characters of Body. If Body is longer than maxlength 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

Message, specified as a matlab.net.http.Message object or vector of Message objects.

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

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-w

<< 62581 total characters of text/html UTF-8 data >>

Version History

Introduced in R2016b