delphi - HMRC 欺诈预防标头 - Delphi
问题描述
我正在使用 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"]},
关于我做错了什么的任何想法?
解决方案
推荐阅读
- reactjs - React:我怎样才能让这个 React 组件写得更好更高效?
- ios - 从 iPhone 中删除我的帐户时,应用内购买是否有效?
- node.js - 从 api 获取数据时出现空白屏幕
- reactjs - 如何让 API 调用等到我们获得所需的数据?
- vaadin - Vaadin TextField 的值在快捷方式侦听器中不可用
- php - 在我的联系表格中发送消息没有任何意义
- javascript - Jest vue3:SyntaxError:意外的令牌“导出”(信号)
- windows - 如何获取不包含特定类型文件的文件夹/子文件夹列表?
- gradle - 在 Android Studio 中允许 HTTP 下载
- google-api - googleapi servicenetworking上的terraform后端500错误