Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var request = require('request');
- username = "",
- password = "",
- url = "http://207.188.73.88:8000/sap/opu/odata/sap/ZTEE_TIME_SRV/ZTEERESERVESet(Time=time'PT11H00M00S',Date=datetime'2014-03-11T00%3A00%3A00',Location='TAJ',Number=3)",
- auth = "Basic " + new Buffer(username + ":" + password).toString("base64");
- request(
- {
- url : url,
- headers : {
- "Authorization" : auth,
- 'x-csrf-token':'Fetch'
- }
- },
- function (error, response, body) {
- // console.log("JSON data " + response);
- // console.log("body" + body);
- request(
- {
- url : url,
- headers : {
- "Authorization" : auth,
- "X-CSRF-TOKEN":"u6piLO58XoK6udOkQ5Naww=="
- },
- method: 'POST',
- //Lets post the following key/values as form
- form: {
- Time:'PT11H00M00S',
- Date:'2014-03-11T00%3A00%3A00',
- Location:'TAJ',
- Number:3 ,
- }
- },
- function (error, response, body) {
- console.log(body);
- }
- );
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement