delegateTo
Class: matlab.net.http.io.ContentProvider
Namespace: matlab.net.http.io
Delegate to another provider
Syntax
Description
[
sets up a getDataFnc
,length
] = delegateTo(provider
,delegate
,URI
)delegate
ContentProvider
to provide all or part of the subsequent data in
a RequestMessage
. This method initializes properties in the
delegate using properties of this object and supplied parameters, as if a new
message was about to be transmitted using that delegate, and invokes the
complete
, expectedContentLength
, and
start
methods in the delegate
. It
returns a handle to a function, getDataFnc
, that you invoke
to obtain data from the delegate:
[data, stop] = getDataFcn(length)
where the arguments are as described for getData
. You can use any value of length
, but
normally you make this call in your getData
method, passing the
same value that was passed to your method.
To delegate to a provider that provides the entire contents of a message, call
delegateTo
in your start
method. If you
use the delegate to obtain part of the message content, then call
delegateTo
at the appropriate time in your
putData
method.
To obtain data from the delegate, always use the returned
getDataFnc
. Do not call the delegate's
getData
directly because the delegate might provide its
data through some other means.
[
indicates if the getDataFnc
,length
] = delegateTo(___,force
)expectedContentLength
method should return the
length of the data.
Input Arguments
Output Arguments
Attributes
Access | protected |
Version History
Introduced in R2018a
See Also
complete
| expectedContentLength
| getData
| start
| matlab.net.URI