This file contains 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
const WRITE_TOKEN = 'your-buttercms-write-api-key' | |
const express = require("express") | |
const request = require("request") | |
const bodyParser = require("body-parser") | |
const slug = require("slug") | |
const app = express(); | |
app.use(bodyParser.urlencoded({extended: true})) |
This file contains 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 requests | |
response = requests.POST('http://api.benchstat.com/v1/stats', headers={ | |
'Authorization': 'Token TOK1234' | |
}, data={ | |
'values': [42, 43, 44, 45, 46, 8, 12, 19, 27], | |
'units': 'kilobytes', | |
'name': 'File size' | |
}) |
This file contains 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
HTTP/1.0 201 CREATED | |
Date: Fri, 17 Aug 2012 00:20:48 GMT | |
Content-Type: text/html; charset=utf-8 | |
Location: https://power2switch.com/api/v1/enrollments/1917/ |
This file contains 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
{ | |
"meta": { | |
"limit": 20, | |
"next": null, | |
"offset": 0, | |
"previous": null, | |
"total_count": 10 | |
}, | |
"objects": [ | |
{ |
This file contains 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
{ | |
"meta": { | |
"limit": 20, | |
"next": null, | |
"offset": 0, | |
"previous": null, | |
"total_count": 4 | |
}, | |
"objects": [ | |
{ |
This file contains 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
{ | |
"meta": { | |
"limit": 20, | |
"next": null, | |
"offset": 0, | |
"previous": null, | |
"total_count": 1 | |
}, | |
"objects": [ | |
{ |
This file contains 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
{ | |
"meta": { | |
"limit": 20, | |
"next": null, | |
"offset": 0, | |
"previous": null, | |
"total_count": 1 | |
}, | |
"objects": [ | |
{ |