Has anyone ever sent a raw http Post? I can't find answers anywhere, and am totally stuck.

53 views
Skip to first unread message

Ginger Fenway

unread,
Jan 5, 2015, 6:36:33 PM1/5/15
to adwor...@googlegroups.com
No one has responded to a prior post, and I am in such a desperate dilemma that I humbly re-submit this request for a assistance.
I am new to development but have tried working this out myself, using creative examples found on StackOverflow and the other usual suspects.


I HAVE AN HTTP POST WHICH WORKS PROPERLY!
  • Tested on multiple HTTP Client Utilities (such as Rest Console, Postman, PAW, etc).
  • Authentication issues have already been resolved, just need this POST to execute

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




WHAT I NEED HELP WITH:
  • I need this POST within a file which will reside on a local storage device on a desktop machine
  • The file will contain the code required to execute the working HTTP Post Request (pasted above) when opened in a Browser.
    • (again, authentication is not an issue now)

USE CASE:
  • The user will open the file in the browser,
  • the POST will execute when file is opened/loaded
    • Post happens in the background, no user interaction
  • User sees the returned csv in browser window. 

CONSTRAINTS (My Blockers):
  • Must Run client side, can not live on an app server or rely on server scripting
  • Must be Browser based for universal desktop deployment
  • If scripting is required, it must rely only on standard resources present on a local desktop machine
    • Which will be running current versions of desktop OS's (OSX and WIN)


BEST POSSIBLE ANSWER:
(Will you be my hero?)
A detailed example of code, with a POST request formated like the one I have above
Because I may have come so close, so many times, yet failed due to obscure syntax errors, is it possible that...
  • Someone could paste the complete code example, with comments telling me where to plug in my values?
  • With no assumptions that I would know the 'obvious' tags or headers which might have to wrap around the code?

A great big 'Thank You' to anyone who might be able to help.
-Gingy

Jason Stedman

unread,
Jan 6, 2015, 9:24:26 AM1/6/15
to adwor...@googlegroups.com
Ginger,

This forum is dedicated to issues specific to the api itself. Your question is well outside the scope of the api and is more a general coding problem.

That being said, your problem is not as simple as it seems. Even once you get a local html page to load, you wold have to bypass the cross-site scripting safeguards in your browser before it would work. This would be the approach with the shallowest learning curve, but is not a simple thing, nor a good solution.

Hope this helps at least to express the scope of your issue better.

Jason

Michael Cloonan (AdWords API Team)

unread,
Jan 6, 2015, 9:39:10 AM1/6/15
to adwor...@googlegroups.com
Hello,

Unfortunately, storing a static file that you would post repeatedly is not going to work. The access token you use in the Authentication HTTP header is only good for a maximum of one hour before it expires.

Like Jason said, we're here to help you if you have API-specific issues, but I can't help you fulfill your entire use case from scratch. If you do run into API-specific questions about how to make specific kinds of requests, please don't hesitate to ask.

Regards,
Mike, AdWords API Team
Reply all
Reply to author
Forward
0 new messages