Open sushilsth opened 4 years ago
Hi,
How can I get the validation response with 422 http code if the validation is not correct while making post request.
Example: $data = [ 'email' => 'john.doecom', //incorrect email 'first_name' => 'John', 'last_name' => 'Doe', 'username' => 'john.doe', ]; Woocommerce::post('customers', $data); // it throws 500 http code and i can catch the json response
$data = [ 'email' => 'john.doecom', //incorrect email 'first_name' => 'John', 'last_name' => 'Doe', 'username' => 'john.doe', ]; Woocommerce::post('customers', $data); // it throws 500 http code and i can catch the json response
Hi,
How can I get the validation response with 422 http code if the validation is not correct while making post request.
Example:
$data = [ 'email' => 'john.doecom', //incorrect email 'first_name' => 'John', 'last_name' => 'Doe', 'username' => 'john.doe', ]; Woocommerce::post('customers', $data); // it throws 500 http code and i can catch the json response