mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 12:42:34 +00:00
fix(http): correctly set content type for POST requests
This commit is contained in:
@@ -21,6 +21,8 @@ abstract class LidarrAPI {
|
||||
queryParameters: {
|
||||
if (apiKey.isNotEmpty) 'apikey': apiKey,
|
||||
},
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
));
|
||||
return _LidarrAPI(dio, baseUrl: _baseUrl(host));
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:lunasea/api/nzbget/models/status.dart';
|
||||
import 'package:lunasea/api/nzbget/models/version.dart';
|
||||
import 'package:retrofit/retrofit.dart';
|
||||
import 'package:lunasea/vendor.dart';
|
||||
|
||||
part 'api.g.dart';
|
||||
|
||||
@@ -51,6 +49,8 @@ abstract class NZBGetAPI {
|
||||
headers: headers,
|
||||
followRedirects: true,
|
||||
maxRedirects: 5,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
));
|
||||
_attachInterceptor(dio);
|
||||
_setResponseTransformer(dio);
|
||||
|
||||
@@ -27,6 +27,8 @@ abstract class OverseerrAPI {
|
||||
'X-Api-Key': apiKey,
|
||||
...headers,
|
||||
},
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
followRedirects: true,
|
||||
maxRedirects: 5,
|
||||
),
|
||||
|
||||
@@ -68,6 +68,7 @@ class RadarrAPI {
|
||||
headers: headers,
|
||||
followRedirects: followRedirects,
|
||||
maxRedirects: maxRedirects,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -32,6 +32,8 @@ abstract class SABnzbdAPI {
|
||||
headers: headers,
|
||||
followRedirects: true,
|
||||
maxRedirects: 5,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
queryParameters: {
|
||||
if (apiKey.isNotEmpty) 'apikey': apiKey,
|
||||
'output': 'json',
|
||||
|
||||
@@ -36,6 +36,7 @@ class SonarrAPI {
|
||||
queryParameters: {
|
||||
'apikey': apiKey,
|
||||
},
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
headers: headers,
|
||||
followRedirects: followRedirects,
|
||||
|
||||
@@ -51,6 +51,7 @@ class TautulliAPI {
|
||||
queryParameters: {
|
||||
'apikey': apiKey,
|
||||
},
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
headers: headers,
|
||||
followRedirects: followRedirects,
|
||||
|
||||
Reference in New Issue
Block a user