0
urllibを使用してAPIを使用してディスクを注文しようとしていますが、応答としてBad requestを受け取りました。私は何が間違っているかも知れない。何か案は?SoftLayer API投稿時に間違った依頼
url = "https://username:[email protected]/rest/v3/SoftLayer_Product_Order/placeOrder"
data = urllib.urlencode({
"parameters": [{
"virtualGuests": [{"id": idofvirtualguest}],
"prices": [{
"id": 113031,
"categories": [{
"categoryCode": "guest_disk1",
"complexType": "SoftLayer_Product_Item_Category"
}],
"complexType": "SoftLayer_Product_Item_Price"
},
{
"id": 112707,
"categories": [{
"categoryCode": "guest_disk2",
"complexType": "SoftLayer_Product_Item_Category"
}],
"complexType": "SoftLayer_Product_Item_Price"
}
],
"properties": [
{"name": "NOTE_GENERAL", "value": "adding disks"},
{"name": "MAINTENANCE_WINDOW", "value": "now"}
],
"complexType": "SoftLayer_Container_Product_Order_Virtual_Guest_Upgrade"
}]
})
response = urllib.urlopen(url, data)