Sample Header Ad - 728x90

linux - curl read in file attribute from a file

0 votes
2 answers
2733 views
So I have this curl command. But I want to store the API-key in a file called api.txt and have it load where the value is in the curl command. api.txt files contains 'X-Api:' This command works. curl -H 'X-Api:' -T file.zip "https://URL " Tried: curl -H “Content-Type: text/plain” -d “api.txt” -T file.zip "https://URL " Got error: "errors" : [ { "status" : 401, "message" : "Unauthorized" } ] }% Question: 1. How can I load either the actual api key or the expected line from api.txt to parse it into the curl command? 2. is this the way to do this? or a better way?
Asked by Lacer (275 rep)
Jul 13, 2022, 03:51 AM
Last activity: Jul 13, 2022, 01:13 PM