Code Monkey home page Code Monkey logo

app-engine-headers's Introduction

App Engine Headers

This is a trivial Google App Engine application that is the server side counterpart to https://github.com/dansingerman/jQuery-Browser-Language

You can use it to retrieve any http request headers via JSONP.

You can also get useful geolocation headers that Google App Engine provides.

Here is an example http://ajaxhttpheaders.appspot.com/?callback=gimme_headers

Example response:

gimme_headers({
  'Accept-Language': 'en,en-US;q=0.8,fr-CA;q=0.6,fr;q=0.4', 
  'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 
  'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36', 
  'Host': 'ajaxhttpheaders2.appspot.com', 
  'X-Appengine-Region': 'eng', 
  'X-Appengine-City': 'croydon', 
  'X-Appengine-Citylatlong': '51.376165,-0.098234', 
  'Content-Type': '; charset="utf-8"', 
  'X-Appengine-Country': 'GB'
})

Usage

  1. Go to https://console.developers.google.com/ , sign in, and select "Create a project..." in the top menu.
  2. Create the project and make a note of the project ID.
  3. Clone this repo, and add the project ID to the app.yaml file where it says YOUR_APP_ID.
  4. Follow the instructions here to deploy it: https://cloud.google.com/appengine/docs/python/gettingstartedpython27/uploading
  5. It should be available at http://YOUR_APP_ID.appspot.com/?callback=some_callback

app-engine-headers's People

Contributors

dansingerman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.