Advertisement
Guest User

Untitled

a guest
May 28th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. curl -v -X POST
  2. https://app.dominodatalab.com/MYURL
  3. -H 'Content-Type: application/json'
  4. -H 'X-Domino-Api-Key: YOUR_API_KEY'
  5. -d '{"parameters": [ "FOO", "BAR", "ETC"]}'
  6.  
  7. import requests
  8.  
  9. response =
  10. requests.post("https://app.dominodatalab.com/MYURL",
  11. headers = {
  12. "X-Domino-Api-Key": "YOUR_API_KEY",
  13. "Content-Type": "application/json"
  14. },
  15. json = {
  16. "parameters": ["FOO", "BAR", "ETC"]
  17. }
  18. )
  19. print(response.status_code)
  20. print(response.headers)
  21. print(response.json())
  22.  
  23. Meteor.methods({
  24. score_app: function(){
  25. var test = HTTP.call("POST", "https://app.dominodatalab.com/MYURL",
  26. { headers: {
  27. "Content-Type": "application/json",
  28. "X-Domino-Api-Key": "YOUR_API_KEY"
  29. },
  30. data: {'params': [143]
  31. }
  32. },
  33. function (error, result) {
  34. if (!error) {
  35. console.log("http post error")
  36. } else{
  37. console.log(result);
  38. };
  39. });
  40. }
  41. });
  42.  
  43. result: 'You must provide a JSON object in your request body
  44. with a parameters key containing an array of parameters.' } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement