Hi All
I seem to be having difficulty with special headers (I think). I am attempting to retrieve info from a website using an API token which needs to be in the header - in other words, a relatively basic HTTP request. However, the moment I add the header with the “token: {KEY}”, nothing gets written, and I do not see an error message. When I change the token to one that’s incorrect, at least an error pops up and says 403 Forbidden. My output and input config is below:
[[outputs.file]]
files = ["stdout", "/etc/default/metrics.out"]
data_format = "influx"
****************
[[inputs.http]]
urls = [
"https://developer.sepush.co.za/business/2.0/area?id=jhbcitypower2-11-honeydew&test=current"
]
method = "GET"
headers = {"Token" = "###############"}
timeout = "5s"
success_status_codes = [200]
data_format = "json_v2"
I have changed the words “Token” to “Authorization”, but it doesn’t help. I have also read this particular feature request concerning the headers, but unless I am doing something wrong, it, too, does not assist. But I believe it is been implemented in any event.
I am able to retrieve the info I want through Postman using the same credentials and information, which makes me think I am missing something in the config file.
If someone can point me in the right direction I will be very grateful.
Thanks in advance.