日期时间UTC格式。 POST请求无法识别? [OANDA]

时间:2015-10-27 04:12:53

标签: java php datetime curl

我尝试使用OANDA REST api端点创建订单。

http://developer.oanda.com/rest-live/orders/#createNewOrder

我在请求期间设置到期变量时遇到问题,因为我正在尝试创建限价订单,所以我必须设置它。

我用来生成UTC日期时间格式的代码生成了这个

的日期
:MAIN
cls
echo.
SET /p num1="Please enter the first number: "
if %num1%==999 GOTO EOF
cls

:SECOND_NUM
SET /p num2="Please enter the second number: "
if %num2%==999 GOTO EOF
if %num2%==0 GOTO ERROR
echo.
GOTO DIVISION

:DIVISION
SET /A result = %num1% / %num2%
echo The answer of %num1% divided by %num2% = %result% >> results.txt
pause
exit
GOTO CONTINUE



:ERROR
echo Error! Cannot divide by 0 (zero). Enter a non zero second number, please.
GOTO SECOND_NUM


:CONTINUE
echo To Exit the program, please enter 999
GOTO MAIN
echo.
pause 
EXIT

但是我收到了这条消息

2016-04-23T15:57:05.000Z

或许有关UTC DateTime需要编码的内容?我使用URI编码的日期时间发出了一个curl请求,但仍然收到了此消息。

POST https://api-fxtrade.oanda.com/v1/accounts/<accNumber>/orders&instrument=EUR_USD&units=1&side=buy&type=limit&expiry=2016-04-23T15:57:05.000Z&price=1.0 HTTP/1.1
{"code":38,"message":"No matching handler for request with uri \/v1\/accounts\/309077\/orders&instrument=EUR_USD&units=1&side=buy&type=limit&expiry=2016-04-23T15:57:05.000Z&price=1.0","moreInfo":"http:\/\/developer.oanda.com\/docs\/v1\/troubleshooting\/#errors"}

我可以得到的唯一信息不同于一个格式错误的身体是我发送一个像这样的到期卷曲请求

curl -H "Authorization: Bearer XXX-YYY" --data "instrument=EUR_USD&units=1&side=buy&type=limit&expiry=2016-04-01T00%3A00%3A00Z&price=1.0" https://api-fxtrade.oanda.com/v1/accounts/<Acc Number>/orders

{
    "code" : 41,
    "message" : "Received request with malformed body: 'instrument=EUR_USD&units=1&side=buy&type=limit&expiry=2016-04-01T00%3A00%3A00Z&price=1.0'",
    "moreInfo" : "http:\/\/developer.oanda.com\/docs\/v1\/troubleshooting\/#errors"
}

感谢任何帮助。

0 个答案:

没有答案