title: Firebase auth rest api using axios
body: <p>I am trying to use Firebase REST API with Axios on Rect Native project: </p>
  
  <p>No matter what I do... I always receive the same error:  </p>
  
  <pre><code>handleLogin = () =&gt; {
          //alert('trying to login....');
          const onSuccess = ({ data }) =&gt; {
              alert('Success!!!!');
              // Set JSON Web Token on success
              //setClientToken(data.token);
              this.setState({ isLoading: false, isAuthorized: true });
              navigation.navigate('Home');
          };
  
          const onFailure = (error) =&gt; {
              alert('Error!!!!');
              console.log(error &amp;&amp; error.response);
              this.setState({ errors: error.response.data, isLoading: false });
          };
          const signupUser = async () =&gt; {
              try {
                  // set the url
                  const url =
                      'https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=.............';
                  // request data object
                  const data = {
                      email: this.state.email,
                      password: this.state.password,
                      returnSecureToken: true,
                  };
  
                  // set the headers
                  const config = {
                      headers: {
                          'Content-Type': 'application/x-www-form-urlencoded',
                      },
                  };
  
                  const res = await axios.post(url, data, config);
                  console.log(res.data);
                  onSuccess(res.data);
              } catch (err) {
                  console.error(err);
                  onFailure(err);
              }
          };
          signupUser();
      };
  </code></pre>
  
  <p>I am always receiving error 400 with the same response: </p>
  
  <p>"code": 400,
        "errors": Array [
          Object {
            "domain": "global",
            "message": "ADMIN_ONLY_OPERATION",
            "reason": "invalid",</p>
  
  <p>Does anybody see what I am doing wrong, Thanks!</p>