ncc
library
Classes
Abortable
An HTTP request that can be aborted before it completes.
AbortableMultipartRequest
A MultipartRequest which supports abortion using abortTrigger .
AbortableRequest
A Request which supports abortion using abortTrigger .
AbortableStreamedRequest
A StreamedRequest which supports abortion using abortTrigger .
BaseClient
An abstract base class that implements the ClientMethods interface,
providing a foundation for custom HTTP clients.
BaseRequest
The base class for HTTP requests.
BaseResponse
The base class for HTTP responses.
BaseResponseWithUrl
A BaseResponse with a url field.
ByteStream
A stream of chunks of bytes representing a single piece of data.
Client
The interface for HTTP clients that take care of maintaining persistent
connections across multiple requests to the same server.
ClientMethods
An abstract interface that defines the contract for an HTTP client.
ContentType
A MIME/IANA media type used as the value of the
HttpHeaders.contentTypeHeader header.
GlobalNetworkObservable
Manages global network observers and tracks network state per client.
Headers for HTTP requests and responses.
InMemorySessionStateManager
An in-memory implementation of SessionStateManager .
MediaType
A class representing an HTTP media type, as used in Accept and Content-Type
headers.
MultipartFile
A file to be uploaded as part of a MultipartRequest .
MultipartRequest
A multipart/form-data request.
NccClient
A base HTTP client that integrates network state management and response handling.
NetworkObserver
An abstract interface that defines the methods for observing network events
and responses in the context of a BaseClient. Implementing this interface
allows the observer to receive notifications about changes in network status,
errors, and responses.
OnResponse
A class that encapsulates the details of an HTTP response received
from a server. It includes various properties that describe the content
and status of the response, such as the body, status code, and reason phrase.
Request
An HTTP request where the entire request body is known in advance.
Response
An HTTP response where the entire response body is known in advance.
SessionClient
Abstract class representing an HTTP client that handles session management,
including token renewal and invalid session handling.
SessionStateManager
Abstract class for managing the state of a session, such as cookies.
StreamedRequest
An HTTP request where the request body is sent asynchronously after the
connection has been established and the headers have been sent.
StreamedResponse
An HTTP response where the response body is received asynchronously after
the headers have been received.
Enums
NetworkState
Enum representing the various states of the network.
Mixins
NetworkObservable
Mixin that observes network state changes and allows notifying observers
when the network status or response changes.
Functions
delete (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP DELETE request with the given headers to the given URL.
get (Uri url , { })
→ Future <Response >
Sends an HTTP GET request with the given headers to the given URL.
head (Uri url , { })
→ Future <Response >
Sends an HTTP HEAD request with the given headers to the given URL.
patch (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP PATCH request with the given headers and body to the given
URL.
post (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP POST request with the given headers and body to the given URL.
put (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP PUT request with the given headers and body to the given URL.
read (Uri url , { })
→ Future <String >
Sends an HTTP GET request with the given headers to the given URL and
returns a Future that completes to the body of the response as a String .
readBytes (Uri url , { })
→ Future <Uint8List >
Sends an HTTP GET request with the given headers to the given URL and
returns a Future that completes to the body of the response as a list of
bytes.
runWithClient <R > (R body (), Client clientFactory (), {ZoneSpecification ? zoneSpecification })
→ R
Runs body in its own Zone with the Client returned by clientFactory
set as the default Client .