Package: matlab.net.http
Superclasses: handle
Progress monitor for HTTP message exchange
Use the ProgressMonitor
class to implement a
progress monitor for an HTTP request message. A progress monitor listens
to changes in the properties of this class to implement a display
or update of your choice.
To implement a progress monitor, create a subclass of this class.
Then create an HTTPOptions
object, specify that subclass
as the ProgressMonitorFcn
property, and set the UseProgressMonitor
property
to true
.
An HTTP request starts when you call the RequestMessage.send
method.
The process might involve multiple messages in both directions in
the case of redirects and authentication. MATLAB® calls the done
method
when all transfers have been completed.
During a transfer:
MATLAB sets the Max
, CancelFcn
,
and Direction
properties when you call RequestMessage.send
.
MATLAB sets the Value
property
repeatedly as the body of the request message is sent to indicate
the number of bytes transferred.
When receipt of the ResponseMessage
begins, MATLAB sets Direction
to Response
and
again sets Value
repeatedly.
To cancel the transfer at any time, call the CancelFcn
function.
This action is the same as interrupting the send
function
in the Command Window.
You can display a graphical progress indicator or other indication
of progress after Direction
changes to Reponse
.
For each subsequent Value
, update the indicator
to the current Value
. You can also use this mechanism
to monitor progress programmatically.
obj = matlab.net.http.ProgressMonitor(pName,pValue)
creates
a progress monitor and sets the property specified by pName
to
the value specified by pValue
. You can specify
several argument pairs in any order as pName1,pValue1,...,pNameN,pValueN
.
For a list of property names and their values, see Properties.
done | Indicate all message transfers completed |
Handle. To learn how handle classes affect copy operations, see Copying Objects in the MATLAB documentation.