I'm developing REST API, and It should respond on request made by ahk script. I use node.js as server and mongodb as database. I tested POST my API in postman and it is working. But when I send POST requests from my ahk script, something goes wrong.
Here is my code
URL := "http://localhost:8000/createPlayer"
HttpObj := ComObjCreate("WinHttp.WinHttpRequest.5.1")
HttpObj.Open("POST", URL, 0)
HttpObj.SetRequestHeader("Content-Type", "application/json")
json_str := ({"name": "Any Name"})
Body = json_str
HttpObj.Send(Body)
MsgBox, %Body%
Result := HttpObj.ResponseText
Status := HttpObj.Status
msgbox % "status: " status "`n`nresult: " result
I tried different variations of json_str, but that didn't helped. I would really appreciate if you help me