如何实现HMAC inos native for ios?

时间:2018-02-13 11:04:44

标签: javascript ios json reactjs react-native

我正在尝试使用HMAC Security在本机中调​​用API,但我没有得到如何实现它。请检查我用来调用API的以下代码

_onPostAPICall = () => {    
 console.log("call Post api");    
 this.setState({ isLoading: true });    

 var dateFormat = require('dateformat');    
 var now = new Date();    

 console.log("Date:",dateFormat(now, "yyyymmdd HH:MM:ss"));   

 fetch('APIlink', {   

    method: "Post",   

    body: "JSON.stringify(Parameters)",   

    headers: {    
      'Accept': 'application/json',    
      'Content-Type': 'application/json',    
      'ContentDate' : dateFormat(now, "yyyymmdd HH:MM:ss"),    
    },   
  })    
  .then(response => response.json())      

  .then(json => this._handlePostAPIResponse(json))     

  .catch(error =>     
    this.setState({      
      isLoading: false,     
      message: 'Something bad happened ' + error      
   }));      
 };     

我用谷歌搜索了它。但是没有发现任何线索。 提前谢谢。

0 个答案:

没有答案