This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -i https://api.github.com/users/jasonh-n-austin | |
| HTTP/1.1 200 OK | |
| Server: GitHub.com | |
| Date: Thu, 14 Feb 2013 04:52:06 GMT | |
| Content-Type: application/json; charset=utf-8 | |
| Connection: keep-alive | |
| Status: 200 OK | |
| X-RateLimit-Limit: 60 | |
| X-RateLimit-Remaining: 50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 200 OK | |
| { | |
| "id": 57005215, | |
| "id_str": "57005215", | |
| "name": "Jason Harmon", | |
| "screen_name": "jasonh_n_austin", | |
| "location": "Austin, TX", | |
| "url": "http://pragmaticapi.com", | |
| <snip> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| from flask import Flask | |
| from flask import session, request | |
| from flask import render_template, redirect, jsonify | |
| from flask_sqlalchemy import SQLAlchemy | |
| from flask_oauthlib.provider import OAuth2Provider | |
| from sqlalchemy.orm import relationship | |
| from werkzeug.security import gen_salt | |
| from datetime import datetime, timedelta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -X POST 'https://api.twilio.com/2010-04-01/Accounts/abc123/SMS/Messages.json' -d 'From=%2B15127820461' -d 'To=5125551212' | |
| {"status":401,"message":"Authenticate","code":20003,"more_info":"http:\/\/www.twilio.com\/docs\/errors\/20003"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import datetime | |
| from pytz import timezone | |
| from dateutil.parser import parse | |
| appt = parse("2013-08-16T15:30:15Z") #From UTC/Zulu time | |
| tzinfo = timezone("America/Chicago") #Retrieve timezone info for US Central | |
| apptLocal = appt.astimezone(tzinfo) # Date is modulated as 2013-08-16 10:30:15-05:00 | |
| print apptLocal | |
| # Produces 2013-08-16 10:30:15-05:00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "appointmentTime": { | |
| "value": "2013-08-16T10:30:15Z", // Note this is UTC, or "Zulu time" | |
| "timezone": "America/Chicago" // Note zoneinfo standard | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "address": { | |
| "streetAddress": "123 Privacy Lane", | |
| "city": "Austin", | |
| "stateOrProvince": "TX", | |
| "postalCode": "78701" | |
| }, | |
| "appointmentTime": "2013-08-16T05:30:15-500" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl https://api.example.com/widgets/ -H 'Authorization: Bearer b77yz37w7kzy8v5fuga6zz93' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "access_token": "b77yz37w7kzy8v5fuga6zz93", | |
| "token_type": "bearer", | |
| "expires_in": 2629743 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -u charlie:brown https://snoopy.com |