Skip to content

Instantly share code, notes, and snippets.

@irvifa
Last active April 24, 2016 00:15
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 irvifa/d681f276470d29ed791e60b91f3163fd to your computer and use it in GitHub Desktop.
Save irvifa/d681f276470d29ed791e60b91f3163fd to your computer and use it in GitHub Desktop.
fishbit2016
import requests
data = {"port":"merak", "depart":"24/04/2016-17:30", "arrive":"24/04/2016-18:30", "ship_id":1, "crew_id":1, "fish_id":"kakap"}
response = requests.post('http://localhost:5000/api/v01/tap/post', json=data)
print response.json
var settings = {
"async": true,
"url": "http://127.0.0.1/api/v1/sessions",
"method": "POST",
"headers": {
"content-type": "application/json",
},
"data": '{ "session": { "username": "user2", "password": "user2" } }'
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment