def count(): @after_this_request def add_expires_header(response): expires = datetime.utcnow() expires = expires + timedelta(seconds=60) expires = datetime.strftime(expires, "%a, %d %b %Y %H:%M:%S GMT") response.headers["Expires"] = expires return response campaign = request.values.get("campaign", "default") return jsonify(campaign=campaign, count=call_count(campaign))
def count(): @after_this_request def add_expires_header(response): expires = datetime.utcnow() expires = expires + timedelta(seconds=60) expires = datetime.strftime(expires, "%a, %d %b %Y %H:%M:%S GMT") response.headers['Expires'] = expires return response campaign = request.values.get('campaign', 'default') return jsonify(campaign=campaign, count=call_count(campaign))