Thanks to anyone for taking the time!
I am new to development so I searched and experimented before coming here to ask.
I need to create a single (html?) file, containing only the code required to execute an HTTP Post request for an ad hoc report, when the file is loaded (opened) in a browser (or maybe something like a Bookmarklet). The user will open the file in the browser, and they see the resulting csv. (this is a constriction of the environment, there is no work around)
This is my POST. It works with HTTP Client Test Utilities (such as Postman or PAW).
POST /api/adwords/reportdownload/v201409?__rdquery=SELECT%20CampaignId%2C%20ClickType%2C%20Impressions%20FROM%20CAMPAIGN_PERFORMANCE_REPORT%20DURING%20THIS_MONTH&__fmt=CSV HTTP/1.1
Authorization: Bearer xxxxxxxxxxx
developerToken: xxxxxxxxxxx
clientCustomerId: xxxxxxxxxxx
Content-Type: application/octet-stream
Host: adwords.google.com
Connection: close
I want to load this in a browser and return the csv. My research tells me it might work wrapped in plain html, might need to be part of a simple, inline javascript, or might require a 'form'.
I have tried dozens of gists, stackoverflow examples, etc, but I can't seem to find anyone doing exactly what I'm trying to do.
I don't know if its more complicated then I think, or less, but does someone have a detailed example with a post formated like the one I have above?