mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-17 22:29:15 +00:00
fix: Force JSON content-type for REST API requests
This commit is contained in:
parent
7a80590fc8
commit
a690fb5089
|
@ -30,7 +30,11 @@ class BackblazeApi extends ApiMap {
|
|||
|
||||
@override
|
||||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
final BaseOptions options = BaseOptions(
|
||||
baseUrl: rootAddress,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
);
|
||||
if (isWithToken) {
|
||||
final BackblazeCredential? backblazeCredential =
|
||||
getIt<ApiConfigModel>().backblazeCredential;
|
||||
|
|
|
@ -26,7 +26,11 @@ class CloudflareApi extends DnsProviderApi {
|
|||
|
||||
@override
|
||||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
final BaseOptions options = BaseOptions(
|
||||
baseUrl: rootAddress,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
);
|
||||
if (isWithToken) {
|
||||
final String? token = getIt<ApiConfigModel>().dnsProviderKey;
|
||||
assert(token != null);
|
||||
|
|
|
@ -26,7 +26,11 @@ class DesecApi extends DnsProviderApi {
|
|||
|
||||
@override
|
||||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
final BaseOptions options = BaseOptions(
|
||||
baseUrl: rootAddress,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
);
|
||||
if (isWithToken) {
|
||||
final String? token = getIt<ApiConfigModel>().dnsProviderKey;
|
||||
assert(token != null);
|
||||
|
|
|
@ -36,7 +36,11 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
|||
|
||||
@override
|
||||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
final BaseOptions options = BaseOptions(
|
||||
baseUrl: rootAddress,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
);
|
||||
if (isWithToken) {
|
||||
final String? token = getIt<ApiConfigModel>().serverProviderKey;
|
||||
assert(token != null);
|
||||
|
|
|
@ -37,7 +37,11 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
|||
|
||||
@override
|
||||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
final BaseOptions options = BaseOptions(
|
||||
baseUrl: rootAddress,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
);
|
||||
if (isWithToken) {
|
||||
final String? token = getIt<ApiConfigModel>().serverProviderKey;
|
||||
assert(token != null);
|
||||
|
|
Loading…
Reference in a new issue