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 Response
. 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(Name,Value)
creates
a progress monitor with
additional properties specified by one, or more name-value pair arguments. Name
is
the property name and Value
is the corresponding
value. You can specify several name-value pair arguments in any order
as Name1,Value1,...,NameN,ValueN
. Unspecified properties
are set to their default values.
done | Indicate all message transfers completed |
Handle. To learn how handle classes affect copy operations, see Copying Objects.