現在、私のアプリはhttp://flask.pocoo.org/docs/testing/の提案でテストしていますが、投稿リクエストにヘッダーを追加したいと思います。Flask and Werkzeug:カスタムヘッダーを使用した投稿リクエストのテスト
self.app.post('/v0/scenes/test/foo', data=dict(image=(StringIO('fake image'), 'image.png')))
が、私は、要求へのコンテンツ-MD5を追加したいと思います:
私の要求は、現在あります。これは可能ですか?
マイ調査:は(フラスコ/ testing.py中)
フラスコクライアントは、ここでは文書化され、WERKZEUGのクライアントを拡張: http://werkzeug.pocoo.org/docs/test/
を見てわかるように、post
はopen
を使用しています。しかし、open
は、次のもののみを持っています:
Parameters:
as_tuple – Returns a tuple in the form (environ, result)
buffered – Set this to True to buffer the application run. This will automatically close the application for you as well.
follow_redirects – Set this to True if the Client should follow HTTP redirects.
それはサポートされていないようです。しかし、どうすればそのような機能を動作させることができますか?