我正在使用Delphi(REST)在MTD增值税沙箱中提交HMRC欺诈预防标头。
这些正在工作:-
RESTRequest1.Params.AddHeader('Gov-Client-Connection-Method', UriEncode('DESKTOP_APP_DIRECT'));
RESTRequest1.Params.AddHeader('Gov-Client-Device-ID', UriEncode('beec798b-b366-47fa-b1f8-92cede14a1ce'));
RESTRequest1.Params.AddHeader('Gov-Client-Local-IPs', UriEncode('10.1.2.3'));
RESTRequest1.Params.AddHeader('gov-client-mac-addresses', UriEncode('30-65-EC-6F-C4-58'));
这些无效(使用HMRC数据示例):-
RESTRequest1.Params.AddHeader('Gov-Client-Timezone', UriEncode('UTC+00:00'));
RESTRequest1.Params.AddHeader('Gov-Client-Screens', UriEncode('width=1920&height=1080&scaling-factor=1&colour-depth=16'));
RESTRequest1.Params.AddHeader('Gov-Client-Window-Size', UriEncode('width=1256&height=803'));
RESTRequest1.Params.AddHeader('Gov-Client-User-Agent', UriEncode('Windows/10 (Dell/XPS15)'));
RESTRequest1.Params.AddHeader('Gov-Client-Multi-Factor', UriEncode('type=AUTH_CODE×tamp=2017-04-21T13%3A23%3A42Z&unique-reference=c672b8d1ef56ed28,type=TOTP×tamp=2017-05-19T13%3A10%3A00Z&unique-reference=ac73430ffdfd9'));
RESTRequest1.Params.AddHeader('Gov-Vendor-Version', UriEncode('My%20Desktop%20Software=1.2.3.build4286'));
RESTRequest1.Params.AddHeader('gov-vendor-license-ids', UriEncode('my%20licensed%20software=8D7963490527D33716835EE7C195516D5E562E03B224E9B359836466EE40CDE1'));
我已经在Postman(https://www.postman.com/)中使用了所有上述HMRC数据示例,并且所有示例都被接受。
以1个不起作用的示例为重点:-
RESTRequest1.Params.AddHeader('Gov-Client-Timezone', UriEncode('UTC+00:00'));
我收到以下答复:-
"INVALID_HEADER","message":"The header value is not in the format: 'UTC±<hh>:<mm>'.","headers":["gov-client-timezone"]},{"code":"INVALID_HEADER","message":"The offset value (hh:mm) provided is not correct. The header value should be in the format: 'UTC±<hh>:<mm>'.","headers":["gov-client-timezone"]},
关于我在做什么错的任何想法吗?