From 6b8e749abfd1e4d642d9aad82847816306e12950 Mon Sep 17 00:00:00 2001 From: Omar Hatem Date: Mon, 26 Sep 2022 23:12:32 +0200 Subject: [PATCH] Fix SimpleSwap create exchange (#522) * Check for status code 201 instead of 200 to follow SimpleSwap API documentation * allow 200 and 201 success status code --- lib/exchange/simpleswap/simpleswap_exchange_provider.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/exchange/simpleswap/simpleswap_exchange_provider.dart b/lib/exchange/simpleswap/simpleswap_exchange_provider.dart index cf6fb3d38..1183de696 100644 --- a/lib/exchange/simpleswap/simpleswap_exchange_provider.dart +++ b/lib/exchange/simpleswap/simpleswap_exchange_provider.dart @@ -91,7 +91,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider { final response = await post(uri, headers: headers, body: json.encode(body)); - if (response.statusCode != 200) { + if (response.statusCode != 200 && response.statusCode != 201) { if (response.statusCode == 400) { final responseJSON = json.decode(response.body) as Map; final error = responseJSON['message'] as String;