Method class

Define an HTTP method Must be use inside a ChopperApi definition.

Recommended: Get, Post, Put, Delete, Patch, Head should be use instead.

@Get(headers: const {'foo': 'bar' })
Future<Response> myGetRequest();

The annotated method must always return a Future<Response>.

The Response type also support typed parameters like Future<Response<MyObject>>. However chopper will not automatically convert the body response to you type, a Converter need to be specified.

Implementers
Annotations

Constructors

Method(String method, {String path: '', Map<String, String> headers: const {}})
const

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
headers Map<String, String>
Headers Map that should be apply to the request
final
method String
HTTP method for the request
final
path String
Path to the request that will be concatenated with the ChopperApi.baseUrl.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited