put method

  1. @override
Future<Response> put(
  1. Uri url, {
  2. Map<String, String>? headers,
  3. Object? body,
  4. Encoding? encoding,
})
override

Sends an HTTP PUT request with the given headers to the given URL. It checks first to see if there is a client, if there is it uses the client assuming it has authorization information, otherwise it calls the newHeaders method to obtain headers and makes the request

Implementation

@override
Future<http.Response> put(Uri url,
        {Map<String, String>? headers,
        Object? body,
        Encoding? encoding}) async =>
    client == null
        ? await http.put(
            url,
            headers: await newHeaders(headers),
            body: body,
            encoding: encoding,
          )
        : await client!.put(
            url,
            headers: headers,
            body: body,
            encoding: encoding,
          );