DwinsHs for Inno Setup: How to add an apikey HTTP header of a request?

試著忘記壹切 提交于 2021-02-08 06:52:24

问题


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.

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.

This is the code:

[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)

回答1:


I found the solution;

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

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

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

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


来源:https://stackoverflow.com/questions/61584074/dwinshs-for-inno-setup-how-to-add-an-apikey-http-header-of-a-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!