问题
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