Main Content

start

Class: matlab.net.http.io.ContentProvider
Namespace: matlab.net.http.io

Start data transfer from ContentProvider

Syntax

start(provider)

Description

start(provider) is called each time MATLAB® is ready to start the transfer of a data stream by calling getData one or more times. Each time this is called, the provider is expected to reset so that the next call to getData goes back to the beginning of the data stream.

Calling start indicates that a connection to the server has been established and transfer of data is about to start. A subsequent call to start (without an intervening call to the complete method) might indicate that the server requested a redirect to a different server, or requires another try with authentication credentials, and this could occur before, during, or after transmission of the data stream.

If your provider is restartable, reset your provider so that the next call to getData returns to the beginning of the data stream, and ensure that the restartable method returns true.

If your provider is not restartable for the same message, but can be reused for a new message, ensure restartable returns false.

Subclasses that override this method should always call their superclass method first. If the provider was already started and is not restartable, then start throws an exception by default.

This method is the best place to implement costly initialization that is not needed until the server is ready to receive data, as opposed to the complete method, which must do initialization necessary to create the message header. If the server cannot be contacted or rejects the message, then MATLAB does not call start.

Input Arguments

expand all

Content provider, specified as a matlab.net.http.io.ContentProvider object.

Version History

Introduced in R2018a