put method
Makes a PUT request to the specified endpoint (used for updates)
endpoint
- The API endpoint (will be appended to the base URL)
body
- The request body (will be serialized to JSON)
queryParams
- Optional query parameters to append to the URL
headers
- Optional headers to include in the request
formData
- Optional form data (for application/x-www-form-urlencoded)
useFullUrl
- If true, endpoint
is treated as a complete URL
Returns a Future<PlexApiResult> containing the response
Implementation
Future<PlexApiResult> put(
String endpoint, {
dynamic body,
Map<String, dynamic>? queryParams,
Map<String, String>? headers,
Map<String, dynamic>? formData,
bool useFullUrl = false,
}) async {
final url = useFullUrl ? endpoint : endpoint;
final response = await PlexNetworking.instance.put(
url,
query: queryParams,
headers: headers,
body: body,
formData: formData,
);
return _handleResponse(response);
}