2016-01-21 44 views

回答

0

call_api該方法採用參數response_type其可具有以下值之一:

  • 被在Python支持通常的數據類型:intstrbool等對應於
  • 該模型通過API調用返回的對象:swagger_client.models.*

如果未傳遞此參數,則由0123返回的值將是None

在這種情況下:

response = client.call_api('/student', 'POST', response_type = swagger_client.models.Student) 

將返回Student類型的對象和

response = client.call_api('/student', 'POST', response_type = 'str') 

將返回字符串。