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

Main Content

Class: matlab.net.http.MessageBody
Namespace: matlab.net.http

Display or return formatted version of message body data

Syntax

Description

show([body](#bu9bka%5F-1-body)) displays the entireData property of a message body if Data is a scalar string or character vector. For other types, the method displays a message indicating the length of the data in bytes, if known. If length is unknown, then the value displayed is the length of the data if body were sent in a request message.

The show method formatsData when possible. For example, the method puts separators between parts of a multipart message and separately converts each part to a string. IfData is a string or character vector, then the string andshow methods return the same value.

Use this method for diagnostics or debugging.

example

show([body](#bu9bka%5F-1-body),[maxlength](#bu9bka%5F-1-maxlength)) displays the first maxlength characters of Data. If Data 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

Number of bytes to convert, specified as an integer.

Examples

expand all

Display data about an image received from the Hubble Heritage website.

req = matlab.net.http.RequestMessage; uri = matlab.net.URI('http://heritage.stsci.edu/2007/14/images/p0714aa.jpg'); r = send(req,uri); show(r.Body)

<< 201317 bytes of image/jpeg data >>

Request the MATLABĀ® webread documentation from mathworks.com.

uri = matlab.net.URI('https://www.mathworks.com/help/matlab/ref/webread.html'); request = matlab.net.http.RequestMessage; r = send(request,uri);

Display the first 100 characters of the message body.

Read content from RESTful web service - MATLAB webrea <p><< 115501 total characters of text/html UTF-8 data >></p> <h2 id="version-history"><a class="anchor" aria-hidden="true" tabindex="-1" href="#version-history"><svg class="octicon octicon-link" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Version History</h2><p><strong>Introduced in R2016b</strong></p>