anlat_
anlat_
RRailway
Created by anlat_ on 8/9/2023 in #✋|help
Server returns a 400 Bad Request error.
I wonder about how I can view every http POST, GET commands in the railway app. In doing so, I might be able to pinpoint what's going wrong.
11 replies
RRailway
Created by anlat_ on 8/9/2023 in #✋|help
Server returns a 400 Bad Request error.
OK. thanks
11 replies
RRailway
Created by anlat_ on 8/9/2023 in #✋|help
Server returns a 400 Bad Request error.
flutter main.dart Future<void> _register() async { try { final response = await http.post( Uri.parse('https://wk.up.railway.app/dj-rest-auth/registration/'), headers: <String, String>{ 'Content-Type': 'application/json; charset=UTF-8', }, body: jsonEncode(<String, String>{ 'username': _usernameController.text, 'email': _emailController.text, 'password1': _passwordController.text, 'password2': _confirmPasswordController.text, }), ); if (response.statusCode == 201) { ScaffoldMessenger.of(context).showSnackBar(SnackBar( content: Text('Registration successful!'), backgroundColor: Colors.green, )); // Navigate to Home Page after a short delay to let the SnackBar show Future.delayed(Duration(seconds: 2), () { Navigator.pop(context); }); } else { print('Response body: ${response.body}'); if (response.body.isNotEmpty) { // Only attempt to decode if the body is not empty Map<String, dynamic> responseBody = json.decode(response.body); String error = responseBody.values.first[0]; throw Exception(error); } else { throw Exception('Registration failed without a specific reason.');        }       }
11 replies
RRailway
Created by anlat_ on 8/9/2023 in #✋|help
Server returns a 400 Bad Request error.
tnx
11 replies
RRailway
Created by anlat_ on 8/9/2023 in #✋|help
Server returns a 400 Bad Request error.
If you dont mind I will sent it a few hours letter. I just left my flat.
11 replies