Webhooks with Classic ASP

614 views
Skip to first unread message

Dave Young

unread,
Mar 11, 2013, 11:25:13 AM3/11/13
to mailchimp-...@googlegroups.com
Hi,

I'm trying to capture data send out from mail chimp via webhooks.

I can see that the http post contains data as the content link is not 0.

However I think I am being particularly stupid as I can't seem to reference the data in order to write the content to a database!

should I just be writing something like:

request("fired_at") or doing a BinaryRead?

I've tried so many different things I'm now going round in circles.

Any help much appreciated :-)

Thanks

Dave

jesse

unread,
Mar 11, 2013, 11:46:07 AM3/11/13
to mailchimp-...@googlegroups.com
It's a POST just like if you POSTed a form to your ASP script, so collect the data the same way you would the form fields.


jesse

Dave Young

unread,
Mar 11, 2013, 12:13:04 PM3/11/13
to mailchimp-...@googlegroups.com
So this should work then:

strSQL = "INSERT INTO [MailChimp].[dbo].[query] ([querystring]) VALUES ('fired:-" & request.form("fired_at") & "')"

But it does not, I know the DB connection works as this request:

for each x in Request.ServerVariables
  str = str + "<B>" & x & ":</b> " & Request.ServerVariables(x) & "<p />"
next

returns data:

ALL_HTTP: HTTP_CONTENT_LENGTH:414 HTTP_CONTENT_TYPE:application/x-www-form-urlencoded HTTP_ACCEPT:*/* HTTP_HOST:mailchimp.************ HTTP_USER_AGENT:MailChimp.com ALL_RAW: Content-Length: 414  Content-Type: application/x-www-form-urlencoded  Accept: */*  Host: mailchimp.************  User-Agent: MailChimp.com  APPL_MD_PATH: /LM/W3SVC/1416937125/RootAPPL_PHYSICAL_PATH: C:\Inetpub\mailchimp\AUTH_PASSWORD: AUTH_TYPE: AUTH_USER: CERT_COOKIE: CERT_FLAGS: CERT_ISSUER: CERT_KEYSIZE: CERT_SECRETKEYSIZE: CERT_SERIALNUMBER: CERT_SERVER_ISSUER: CERT_SERVER_SUBJECT: CERT_SUBJECT: CONTENT_LENGTH: 414CONTENT_TYPE: application/x-www-form-urlencodedGATEWAY_INTERFACE: CGI/1.1HTTPS: offHTTPS_KEYSIZE: HTTPS_SECRETKEYSIZE: HTTPS_SERVER_ISSUER: HTTPS_SERVER_SUBJECT: INSTANCE_ID: 1416937125INSTANCE_META_PATH: /LM/W3SVC/1416937125LOCAL_ADDR: 192.168.0.56LOGON_USER: PATH_INFO: /default.aspPATH_TRANSLATED: C:\Inetpub\mailchimp\default.aspQUERY_STRING: 1=12222REMOTE_ADDR: 184.173.98.68REMOTE_HOST: 184.173.98.68REMOTE_USER: REQUEST_METHOD: POSTSCRIPT_NAME: /default.aspSERVER_NAME: mailchimp.************SERVER_PORT: 80SERVER_PORT_SECURE: 0SERVER_PROTOCOL: HTTP/1.1SERVER_SOFTWARE: Microsoft-IIS/6.0URL: /default.aspHTTP_CONTENT_LENGTH: 414HTTP_CONTENT_TYPE: application/x-www-form-urlencodedHTTP_ACCEPT: */*HTTP_HOST: mailchimp.************HTTP_USER_AGENT: MailChimp.com




Dave Young 
Scout Leader, 1st Sarisbury Green Scouts
Explorer Scout Leader, Fareham West Explorers - Minkies 
da...@iexplore.me.uk


--
You received this message because you are subscribed to a topic in the Google Groups "MailChimp API Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mailchimp-api-discuss/lbYS3FHIF38/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to mailchimp-api-di...@googlegroups.com.
To post to this group, send email to mailchimp-...@googlegroups.com.
Visit this group at http://groups.google.com/group/mailchimp-api-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

jesse

unread,
Mar 11, 2013, 12:26:14 PM3/11/13
to mailchimp-...@googlegroups.com, da...@iexplore.me.uk
If that's how you should handle form data in ASP, then yes. I can guess at all sorts of reasons the insert may not work, but you'll just need to do standard debugging/error handling on your side to figure out what's up.

The second part has nothing to do with anything, up to and including db access. If need be, go look up what you can expect to see in ServerVariables.


jesse
To unsubscribe from this group and all its topics, send an email to mailchimp-api-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages