用于Inno设置的DwinsHs:如何添加请求的apikey HTTP标头? [英] DwinsHs for Inno Setup: How to add an apikey HTTP header of a request?

查看:43
本文介绍了用于Inno设置的DwinsHs:如何添加请求的apikey HTTP标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用名为DwinsHs的第三方工具进行Inno Setup.

I'm using a third party tool by the name of DwinsHs for Inno Setup.

此第三方工具为我提供了在安装过程中下载文件的功能.

This third party tool provides me the capability for downloading files as part of the installation.

我想将HTTPS请求发送到远程服务器,并且我想将 apikey 传递给请求的标头,但它返回错误401.

I want to send an HTTPS request to remote server and I would like to pass an apikey to the header of the request but it returns error 401.

这是代码:

[ISPP]
#define fileURL "https://myserver.xom?apikey=XXXX-XXXX-XXXX-XXXX"

[Code]
Source: "<path_to_my_file>"; \
  DestDir: "{app}"; \
  Flags: external deleteafterinstall; \
  Check: DwinsHs_Check( ExpandConstant('<path_to_my_file>'), '{#fileURL}', 'mySetup', 'Get', 0, 0)

推荐答案

我找到了解决方案;

因此,请保留网址,而不使用?apkikey = ...

So, keep the url without ?apkikey=...

[ISPP]
#define fileURL "https://myserver.xom"

并在 dwinshs.iss 中编辑 const HTTP_HEADER ,并在标头中添加 apikey :

And adding the apikey in the header by editing const HTTP_HEADER in dwinshs.iss:

  HTTP_HEADER = 'apikey: xxxx-xxxx-xxxx-xxxx';

这篇关于用于Inno设置的DwinsHs:如何添加请求的apikey HTTP标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆