originally posted in:BungieNetPlatform
View Entire Topic
Hello all,
Is anyone able to provide an example of how one can construct a POST request to an endpoint.
I am looking at the transfer item request but not sure what format I need to send the params in.
Do I need to create a JSON object with the info or include them as headers?
Thanks
Matt
English
-
[quote]POST https://www.bungie.net/Platform/Destiny/TransferItem/ {"membershipType":"2","characterId":"xxxxxxxxx","itemId":"xxxxxxxxx","itemReferenceHash":"xxxxxxxxx","stackSize":1,"transferToVault":false}[/quote] The JSON object is serialised and placed in the body of the POST request. If you're using cURL in PHP, it's simply:[quote]curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($obj));[/quote]