2017-06-21 71 views

回答

0

我通过将POST的'Content-Type'标题设置为'application/json'来清除这个错误。

0

在我的PHP的情况下,而不是使用JSON字符串,我去了一个URL字符串,并清除了错误。

使用Node.js语言或JavaScript,这个工作对我来说没有问题:

var settings = { 
    "async": true, 
    "crossDomain": true, 
    "url": "https://shapeshift.io/sendamount", 
    "method": "POST", 
    "headers": { 
     "Content-Type": "application/x-www-form-urlencoded" 
    }, 
    "data": { 
     "amount": ".002", 
     "pair": "ltc_btc" 
    } 
    } 

    $.ajax(settings).done(function (response) { 
    console.log(response); 
    });