Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a user agent header to the underscores.me request

  • Loading branch information...
commit 9909ffd7653a7d0ea422d1edd4c14ce9eedd8f66 1 parent 28c1afb
@evansolomon authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 _sh
View
5 _sh
@@ -30,7 +30,7 @@ description = raw_input('Description? ')
generate = 1
generate_submit = 'Generate'
-# Setup the POST data
+# Setup the request data
data = {
'underscoresme_name': name,
'underscoresme_slug': slug,
@@ -41,9 +41,10 @@ data = {
'underscoresme_generate_submit': generate_submit
}
post_body = urllib.urlencode(data)
+headers = {'User-Agent': '_sh'}
# Make the request
-request = urllib2.Request('http://underscores.me', post_body)
+request = urllib2.Request('http://underscores.me', post_body, headers)
response = urllib2.urlopen(request)
response.fp
Please sign in to comment.
Something went wrong with that request. Please try again.