fetchx 0.0.3+alpha copy "fetchx: ^0.0.3+alpha" to clipboard
fetchx: ^0.0.3+alpha copied to clipboard

outdated

Fetchx is a simple, fast, and secure HTTP client for Dart. It leverages extensions to allow using url-like strings to make http requests.

example/example.md

import 'package:fetchx/fetchx.dart';

void main() async {
  //Get Method
  Response response =
      await 'https://jsonplaceholder.typicode.com/posts/1'.get();
  print(response.body);

  //Post Method
  response = await 'https://jsonplaceholder.typicode.com/posts'.post(
    {
      'title': 'foo',
      'body': 'bar',
      'userId': 1,
    },
  );
  print(response.body);

  // Put Method
  response = await 'https://jsonplaceholder.typicode.com/posts/1'.put(
    {
      'title': 'foo',
      'body': 'bar',
      'userId': 1,
    },
  );
  // print(response.body);

  // Delete Method
  response = await 'https://jsonplaceholder.typicode.com/posts/1'.delete();
  print(response.body);

  // Patch Method
  response = await 'https://jsonplaceholder.typicode.com/posts/1'.patch(
    {
      'title': 'foo',
      'body': 'bar',
      'userId': 1,
    },
  );
  print(response.body);
}
6
likes
0
points
50
downloads

Publisher

unverified uploader

Weekly Downloads

Fetchx is a simple, fast, and secure HTTP client for Dart. It leverages extensions to allow using url-like strings to make http requests.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on fetchx