2015-07-10 56 views
1

我正在從klipfolio向https://api.podio.com/item/app/ {app_id}/filter /發送POST請求,並在提供的主體區域中指定JSON對象。但是,無論我在json對象中指定什麼參數,它們似乎都不起作用。我使用的參數爲每波迪奧API文檔:傳入Podio API過濾器函數的JSON對象似乎不起作用

{ 
    "sort_by": The sort order to use, 
    "sort_desc": True to sort descending, false otherwise, 
    "filters": The filters to apply 
    { 
    "{key}": The value for the key filtering, 
    ... (more filters) 
    }, 
    "limit": The maximum number of items to return, defaults to 30, 
    "offset": The offset into the returned items, defaults to 0, 
    "remember": True if the view should be remembered, false otherwise 
} 

=>但這不起作用

{ 
    "limit": 50 
} 

=>或者這個

{ 
    "sort_by": id, 
    "sort_desc": true, 
    "filters": { 
     "id": { 
      "from": 50, 
      "to": 99 
     } 
    }, 
    "limit": 50, 
    "offset": 0, 
    "remember": false 
} 

我已經嘗試了各種參數,似乎沒有什麼影響結果。即使設置限制爲50這樣簡單的功能也不起作用 - 它仍然會吐出20個結果。有任何想法嗎?

檢查後請求後,我可以看到

Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryjHNZ1IQyAQII1ZrI 

這使我相信KLIPFOLIO實際上不允許一個張貼JSON對象的數據。什麼。

回答

1

在查詢參數部分添加一個名爲'Content-Type'且值爲'application/json'的標頭。