所以我從來沒有使用過HTTP後,我需要發送一個響應,並從相同的接收響應。這裏是我提供的文檔:發送HTTP POST和處理JSON響應
編輯:此代碼示例來自Microsoft Azure機器學習,我必須將其集成到我的Android應用程序來做數據預測。
URL
https://**api-version=2.0&details=true
請求
"Inputs": {
"input1": {
"ColumnNames": [
"Light",
"Proximity",
"Ax",
"Ay",
"Az",
"Gx",
"Gy",
"Gz"
],
"Values": [
[
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0"
],
[
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0"
]
]
}
},
"GlobalParameters": {}
}
樣品響應
{
"Results": {
"output1": {
"type": "DataTable",
"value": {
"ColumnNames": [
"Scored Probabilities for Class \"BackPocket\"",
"Scored Probabilities for Class \"Ear\"",
"Scored Probabilities for Class \"Handbag\"",
"Scored Probabilities for Class \"SidePocket\"",
"Scored Labels"
],
"ColumnTypes": [
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Categorical"
],
"Values": [
[
"0",
"0",
"0",
"0",
"BackPocket"
],
[
"0",
"0",
"0",
"0",
"BackPocket"
]
]
}
}
}
}
如何以Java/Android方式發送此Post Request,然後處理響應?
我完全陌生,因此我不知道。我沒有搜索HTTP POST等,但無法找到足夠的發送和接收響應。任何圖書館的建議也非常感謝。
謝謝。
您使用的是Android上的任何HTTP庫? – Panther
@Panther無。此代碼示例來自Microsoft Azure機器學習,我必須將其集成到我的Android應用程序中才能進行數據預測。 –
[在Android中發送POST數據]可能的重複(http://stackoverflow.com/questions/2938502/sending-post-data-in-android) –