Update the function createUser
to send a request to https://jsonplaceholder.typicode.com/users
to create a new user. The function should accept three parameters, name
, username
andemail
.
Check the HTTP response status code. If the response is not OK (e.g., 404 or 500), log a message Network response was not ok. to the console at the error level. If the request fails due to any other error, log the message in the format Error creating user: <error message> to the console at the error level.
If the request is successful, the function should log the newly created user in the response data with the prefix Created User: to the console.
If the request is successful, log the response data with the prefix Created User: to the console.