2017-08-18 23 views
0

WL.Client.makeRequest()此功能在MFP 8.0中不推薦使用。該功能的用途是什麼?如果您有任何文件請與我分享。MFP 6.3 - WL.Client.makeRequest - 已棄用

,這是什麼正確的解決方案在MFP 8.0

運行遷移命令mfpmigrate scan後。我越來越喜歡這個

Create a custom adapter that provides the same functionality 

請給出相關的功能,什麼替代解決方案在MFP 8.0

感謝, KARTHIK S.

回答

2

WL.Client.makeRequest() API允許進行到端點外呼的任何文件。

在MFP 8.0中,您應該使用WLResourceRequest API。 API文檔here

+0

謝謝,Vivin K. –

2

WL.Client.makeRequest()功能在MFP 8.0

棄用IBM MobileFirst基金會8.0,您必須安裝mfpdev-CLI & 科爾多瓦 - 插件-MFP然後使用WLResourceRequest。請參閱示例:

var resourceRequest = new WLResourceRequest(
    "/adapters/JavaAdapter/users", 
    WLResourceRequest.GET 
); 
var formParams = {"param1": "value1", "param2": "value2"}; 
resourceRequest.sendFormParameters(formParams); 

resourceRequest.send().then(
    onSuccess, 
    onFailure 
) 

我建議您參閱早期版本的MobileFirst Foundation 8.0遷移。在這裏看到:

從早期版本遷移:http://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/upgrading/

遷移現有的科爾多瓦和混合應用:http://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/upgrading/migrating-client-applications/cordova/#starting-the-cordova-app-migration-with-the-migration-assistance-tool

創建一個自定義適配器提供相同的功能

取之旅如何在IBM MobileFirst 8.0中創建自定義適配器:http://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/creating-adapters/

+0

Gaurab Kumar,感謝您的解答。我知道MFP 8.0。但我不知道makeRequest()的正確替換。現在我明白WLResourceRequest是makeRequest的正確替代。謝謝。 –