I am getting a 400 Bad Request error, and can’t seem to figure out what I am messing up.
WWWForm form = new WWWForm();
form.AddField("X-MBX-APIKEY", apiKey);
Dictionary<string, string> headers = new Dictionary<string, string>();
headers.Add("X-MBX-APIKEY", apiKey);
WWW www = new WWW(baseurl+"?"+queryString + "&signature=" + signature, null, headers);
using (UnityWebRequest w = UnityWebRequest.Post(baseurl+"?"+queryString+"&signature="+signature, form))
{
w.SetRequestHeader("X-MBX-APIKEY", apiKey);
yield return w.SendWebRequest();
if (w.result != UnityWebRequest.Result.Success)
{
Debug.Log(w.error);
}
else
{
Debug.Log("Form upload complete!");
}
}
This is how my query looks like
queryString = "symbol=" + symbol + "&side=" + side + "&type=" + type + "&quantity=0.0000001" + "×tamp=" + time;
With values
symbol=BTCUSDT&side=BUY&type=MARKET&quantity=0.0000001×tamp=1663012255286
Any help is appreciated, thanks!