Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:error': 0.03; 'sufficient': 0.05; 'class,': 0.07; 'advance': 0.07; 'method:': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:method': 0.09; 'appengine': 0.16; 'caching': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Post': 0.16; 'wrote:': 0.18; 'app': 0.19; 'help.': 0.21; 'header:User-Agent:1': 0.23; 'error': 0.23; 'proxy': 0.24; 'guys': 0.24; 'post': 0.26; 'asking': 0.27; 'header:X-Complaints-To:1': 0.27; 'code': 0.31; 'requests': 0.31; 'lists': 0.32; 'this.': 0.32; 'could': 0.34; "can't": 0.35; 'but': 0.35; 'google': 0.35; 'add': 0.35; 'there': 0.35; 'fun,': 0.36; 'method': 0.36; 'thanks': 0.36; 'similar': 0.36; 'server': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'hope': 0.61; 'fashion': 0.64; 'more': 0.64; 'forward': 0.65; 'account': 0.65; 'contact': 0.67; 'header :Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'reply- to:addr:gmail.com': 0.80; 'aka': 0.91; 'destination': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Kev Dwyer Subject: Re: Google Appengine Proxy Post method error Date: Tue, 23 Sep 2014 07:22:33 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: cpc5-hari13-2-0-cust222.20-2.cable.virginm.net Mail-Copies-To: kevin.p.dwyer@gmail.com User-Agent: KNode/4.7.2 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: kevin.p.dwyer@gmail.com List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1411453367 news.xs4all.nl 2909 [2001:888:2000:d::a6]:39190 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78194 alextrapp@googlemail.com wrote: > So I got the Labnol Google Appengine proxy but it can't handle the Post > method aka error 405. > > I need help adding this method to the script: > > mirror.py = http://pastebin.com/2zRsdi3U > > transform_content.py = http://pastebin.com/Fw7FCncA > > main.html = http://pastebin.com/HTBH3y5T > > All other files are just small files for appengine that don't carry > sufficient code for this. Hope you guys can help. > > Thanks in advance :) Hello, Very broadly speaking, you need to add a post method to the MirrorHandler class, and in that method: - mung the request in a similar fashion to the get method - avoid caching the request (POST requests are not idempotent) - forward the altered request to the destination server - return the response to the original client The labnol google-proxy githubpage lists a twitter account for support contact - http://twitter.com/labnol - so you could try asking there for more help. Also check the docs for webapp2 and and Google App Engine (http://developers.google.com/appengine). Have fun, Kev