ミメランダー

MIMEメディアタイプを使用したRESTFULリソースバリアントレンダリング用のPythonモジュール
今すぐダウンロード

ミメランダー ランキングとまとめ

広告

  • Rating:
  • ライセンス:
  • MIT/X Consortium Lic...
  • 価格:
  • FREE
  • 出版社名:
  • Martin Blech
  • 出版社のWebサイト:
  • http://code.google.com/u/martinblech/

ミメランダー タグ


ミメランダー 説明

MIMEメディアタイプを使用したRESTFULリソースバリアントレンダリング用のPythonモジュール MimErenderはPythonデコレータを使用してHTTPリクエストハンドラの結果のレンダリング機能を透過的に選択することを可能にするPythonモジュールです。 MimeParseを使用してHTTP Acceptヘッダーを解析し、利用可能な最良の表現を解析します。Currullents(web.py)だけがサポートされています(webpy)。 '%messagerender_json = lambda ** args:json.dumps(args)render_html = Lambdaメッセージ:'%s '%messagerender_txt = Lambdaメッセージ:MessageURLS =(' /(.*) '、' greet ')app = web.application (URL、Globals())クラスのgreart:@mimeRender(デフォルト= 'html'、html = render_html、xml = render_xml、json = render_json、txt = render_txt)def get(self、name):name = ' World 'Return {' message ':' hello、 '+ name +'!__name__ == "__main__"の場合は:app.run()を実行できます。$ curl -h "accept:application / html" localhost: 8080 / x hello、x! $ curl -h "accept:application / xml" localhost:8080 / x <メッセージ>こんにちは、x! $ curl -h "Accept:Application / JSON" localhost:8080 / x {'message': 'こんにちは、x!'} $ curl -h "承認:テキスト/プレーン" localhost:8080 / xhello、x!要件: ・Python


ミメランダー 関連ソフトウェア