POSTしたデータ形式が正しいかをGAEでPachubeのAPIを作って調べる。
#!/usr/bin/env python # -*- coding: utf-8 -*- # gae_PachubeClient_debug.py 2012.4.21 import logging import os import re import time import datetime import StringIO from google.appengine.ext import db from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app class pachubeHandler(webapp.RequestHandler): def post(self,feeds): logging.info(feeds) method = self.request.get('_method') logging.info(method) headers = self.request.headers apikey = headers.get('X-PachubeApiKey') logging.info(apikey) body = self.request.body logging.info(body) self.response.out.write(" ") application = webapp.WSGIApplication([ (r'/v2/feeds/(\d+)\.csv', pachubeHandler), ], debug=True) def main(): run_wsgi_app(application) if __name__ == '__main__': main()---
0 件のコメント:
コメントを投稿