on-internet
← Community

This exception was thrown because the response has a status code of 404 and RequestOptions.validateStatus was configured to throw for this status code

Stack Overflow ·

In flutter I tried to POST data using the DIO package, I posted some data: final response = await dio.post( "127.0.0.1/toko_grosir_api/create.php", data: { 'name': '${event.product.nameProduct}', 'price': '${event.product.priceProduct}', 'desc': '${event.product.descProduct}', 'stock': '${event.product.stockProduct}', 'date': '${event.product.dateProduct}', 'category': '${event.product.categoryProduct}' }, options: Options( contentType: Headers.formUrlEncodedContentType, ), ); and I am trying to receive data using PHP as Rest API with the following code: $nameProd = isset($_POST['name']) ? $_P

Comments

Sign in or sign up to comment and upvote.

No comments yet.