Hello,
Your code you provided in client side is correct. This is a server-side related issue.
"error": "Note: Only defined users succeed registration"
You got this error because it was thrown by the server side. You can set null as the parameter in the post request. It will throw another error: Missing email or username.
var response = await client.PostAsync("https://reqres.in/api/register", null);
It means that the request was sent successfully, but the server side return an error. When you send a request, you should follow the rules of the server side. I'm not sure about the logic on your server side. You could check the log and modify the code on server side.
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.