JavaScript is required to use Bungie.net

Group Avatar

BungieNetPlatform

"Updates, discussions, and documentation of the BungieNetPlatform API."

Request Join
originally posted in:BungieNetPlatform
5/18/2015 6:39:16 PM
1

Example POST request

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

Posting in language:

 

Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

  • [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]

    Posting in language:

     

    Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

You are not allowed to view this content.
;
preload icon
preload icon
preload icon