I got these two example.
Example1:
$data1 = "{'username':'myUserName','password':'myPassWord'}";
and Example2:
$username= "myUserName";
$password= "myPassWord";
$data2 = "{'username':'".$username."','password':'".$password."'}";
Which i send to cUrl post request in php. First example works while second does not. Why is that? I also tried setting variables in associative array, then using json_encode, then send it to cUrl. Nothing works except first example. I'm losing my mind here.