function requestMWAPrice(string _coin, string _market)
public
onlyOwner
returns (bytes32 requestId)
{
Chainlink.Request memory req = buildChainlinkRequest(jobId, address(this), this.fulfill.selector);
req.add("endpoint", "mwa-historic");
req.add("coin", _coin);
req.add("market", _market);
req.add("copyPath", "data.-1.1");
req.addInt("times", 100);
requestId = sendChainlinkRequestTo(oracle, req, oraclePayment);
}
我们需要指定访问我们想要的真实值的路径。注意这一行,req.add('copyPath', "data.-1.1"),但有时我们会使用 req.add('path', ...),我们应该什么时候使用copyPath
,什么时候应该使用path
?