Network API

Explore the powerful tools and techniques available for customizing and controlling network interactions in your application. From modifying HTTP requests and responses to implementing custom retry strategies, this guide provides a comprehensive overview of how to optimize and tailor your network API behavior.

The Network API section provides you with the tools and knowledge needed to fully control and customize the way your application interacts with network resources.

Whether you’re working with HTTP requests, handling responses, or managing retry logic for failed requests, this section covers all the essential techniques and strategies to optimize and tailor your application’s networking behavior.

Overview

In modern applications, the ability to fine-tune how your app communicates with servers is crucial. The Network API offers a suite of powerful functionalities that allow you to:

  • Customize HTTP Requests: intercept and modify outgoing HTTP requests to suit your specific needs.
  • Manipulate HTTP Responses: adjust and refine the responses received from servers before they are processed by your application.
  • Implement Custom Retry Logic: define how and when failed requests should be retried, ensuring robust and reliable network communication.

Important Limitation

🚧

Segment Requests are not supported!

The API currently does not support manipulating segment requests (media/audio, media/video).

Why Customize Your Network API?

Customizing your Network API interactions offers several benefits:

  • Enhanced Security: ensure that sensitive data, such as tokens and credentials, are properly managed in requests and responses.
  • Improved Reliability: implement robust retry logic to handle network failures gracefully and keep your application responsive.
  • Optimized Performance: fine-tune request and response handling to reduce latency, minimize errors, and improve overall application performance.

Getting Started

To begin customizing your Network API, explore each of the sub-sections that delve into the specific areas of request handling, response manipulation, and retry logic:

  • Manipulating HTTP Requests: Learn how to modify headers, adjust URLs, and alter request parameters before they are sent out. This is essential for tasks like adding authorization tokens, redirecting requests, or tweaking request details on the fly.
  • Manipulating HTTP Responses: Discover how to process and modify server responses before they reach your player or application logic. This can be useful for injecting custom data, modifying response headers, or altering response bodies to better fit your needs.
  • Customizing HTTP Request Retries: Gain control over the retry behavior of failed HTTP requests. Learn how to implement custom retry strategies, including setting retry limits, defining delay patterns, and handling specific error conditions effectively.

Each page provides detailed explanations, practical examples, and step-by-step instructions to help you implement the features you need.