Skip to content

Instantly share code, notes, and snippets.

@theonewolf
Created October 11, 2011 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theonewolf/1277064 to your computer and use it in GitHub Desktop.
Save theonewolf/1277064 to your computer and use it in GitHub Desktop.
A little something like this...
Python
from flask import Flask, url_for
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
@app.route('/test/<tester>/')
def test(tester=None):
return tester + " " + url_for('test', tester='blargh')
-----------------------------------------------------------------------------------
C /* not consistent with class notes */
char* ENVP[] = {
"CONTENT_LENGTH=",
"CONTENT-TYPE=",
"GATEWAY_INTERFACE=CGI/1.1",
"QUERY_STRING=action=opensearch&search=HT&namespace=0&suggest=",
"REMOTE_ADDR=128.2.215.22",
"REMOTE_HOST=gs9671.sp.cs.cmu.edu",
"REQUEST_METHOD=GET",
"REQUEST_URI=/test/blargh/////sdfdfsdf",
"PATH_INFO=/test/blarghsefjsdfhskdjfgh/",
"SCRIPT_NAME=/cgi",
"HOST_NAME=en.wikipedia.org",
"SERVER_PORT=80",
"SERVER_PROTOCOL=HTTP/1.1",
"SERVER_SOFTWARE=Liso/1.0",
"HTTP_ACCEPT=application/json, text/javascript, */*; q=0.01",
"HTTP_REFERER=http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search=test+wikipedia+search",
"HTTP_ACCEPT_ENCODING=gzip,deflate,sdch",
"HTTP_ACCEPT_LANGUAGE=en-US,en;q=0.8",
"HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.3",
"HTTP_COOKIE=clicktracking-session=v7JnLVqLFpy3bs5hVDdg4Man4F096mQmY; mediaWiki.user.bucket%3Aext.articleFeedback-tracking=8%3Aignore; mediaWiki.user.bucket%3Aext.articleFeedback-options=8%3Ashow; mediaWiki.user.bucket:ext.articleFeedback-tracking=8%3Aignore; mediaWiki.user.bucket:ext.articleFeedback-options=8%3Ashow",
"HTTP_USER_AGENT=Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1",
"HTTP_CONNECTION=keep-alive",
"HTTP_HOST=en.wikipedia.org",
NULL
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment