Proyecto26.RequestException: HTTP/1.1 400 Bad Request

After following this video :

At min 26, I got the following error :

UnityEngine.Debug:Log(Object)```

And here is my actual code:

```csharp
    public void SignUpUserButton(){
        SignUpUser(emailText.text,usernameText.text,passwordText.text);
    }
    public void SignInUserButton(){
        SignInUser(emailText.text,passwordText.text);
    }

       private void PostToDatabase(bool emptyScore=false){

        User user = new User();
        if (emptyScore){
            user.userScore = 0;
        }
        RestClient.Put(url:databaseURL + localId +".json",user);
      
    }


    private void SignUpUser(string email,string username,string password)
    {
        string userData = "(\"email\":" + email + ",\"password\": "+ password +"\",\"returnSecureToken\":true";
        RestClient.Post<SignResponse>("https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=" + AuthKey,bodyString: userData).Then(response => {
         localId = response.localId;
         idToken = response.idToken;
         playerName = username;
         PostToDatabase(true);
        }).Catch(error =>
        {
            Debug.Log(error);
        });

Using Rest Client API, imported the last version from asset store.

I would really appreciate some help, since I got to deliver my senior project in a week :confused: Thank you!

There’s most likely more to that 400 response from firebase. To see it either fire up the debugger and inspect that exception, or recreate the request in cURL or Postman and see what the message is.

Fixed, had some problems in the userData string, had to use [ instead of ( , and there was some missing " …

I got the same error. in my case, I had a copied code from my previous project. there are three unique values you have to change and those are api_key,client_secret, and client_id. I have used the previous API key and it caused me this error. then I changed that to the new one .now it is working fine.