Skip to content

Repository files navigation

Fetch for NativePHP Mobile

Fetch is a free community networking plugin for NativePHP Mobile. It provides an expressive, fluent API for truly asynchronous HTTP requests on Android and iOS, backed by OkHttp and URLSession.

Requests return a stable ID immediately, while responses, failures, retries, cancellation, and transfer progress are delivered through NativePHP events. Fetch is intended for native application interactions; queued jobs should use Laravel's HTTP client instead.

Features

  • GET, POST, PUT, PATCH, and DELETE requests
  • JSON, form-encoded, raw, and multipart request bodies
  • Multiple attachments and repeated multipart field names
  • Upload and download progress events
  • Streaming file downloads
  • Opt-in retries with exponential backoff
  • Per-attempt timeouts and explicit cancellation
  • Request-local base URLs and reusable application macros
  • Fluent PHP and official JavaScript clients
  • Request fakes for Pest and PHPUnit tests

Compatibility

Fetch 1.x supports PHP 8.4+, NativePHP Mobile ^4.1, Android API 29+, and iOS 18+. The NativePHP constraint includes all compatible 4.x releases and excludes future major versions.

Documentation

Read the complete documentation at victorycodedev.github.io/nativephp-fetch.

Installation

See the installation guide.

Usage (PHP)

See making requests with PHP and the NativeComponent example.

Usage (JavaScript)

See the JavaScript client guide.

Feature guides

Support

Report bugs or request help through the GitHub issue tracker.

License

NativePHP Fetch is open-source software released under the MIT License.

About

Truly asynchronous native HTTP networking for NativePHP Mobile on iOS and Android

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages