delegateTo
Class:matlab.net.http.io.ContentProvider
Package:matlab.net.http.io
Delegate to another provider
Syntax
Description
[
sets up agetDataFnc
,length
] = delegateTo(provider
,delegate
,URI
)delegate
ContentProvider
to provide all or part of the subsequent data in aRequestMessage
. 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 thecomplete
,expectedContentLength
, andstart
methods in thedelegate
. 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 forgetData
. You can use any value oflength
, but normally you make this call in yourgetData
method, passing the same value that was passed to your method.
To delegate to a provider that provides the entire contents of a message, calldelegateTo
in yourstart
method. If you use the delegate to obtain part of the message content, then calldelegateTo
at the appropriate time in yourputData
method.
To obtain data from the delegate, always use the returnedgetDataFnc
. Do not call the delegate'sgetData
directly because the delegate might provide its data through some other means.
[
indicates if thegetDataFnc
,length
] = delegateTo(___,force
)expectedContentLength
method should return the length of the data.
Input Arguments
Output Arguments
Attributes
Access |
protected |