Created
September 2, 2018 14:53
-
-
Save markroxor/8b3150164cbe58ca7d4f069ec0383076 to your computer and use it in GitHub Desktop.
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 axios = require('axios'); | |
// Make a request for a user with a given ID | |
var server_url = 'http://127.0.0.1:5000' | |
var url = server_url + '/v1/envs/'; | |
var msg = {'env_id': 'CartPole-v0'}; | |
let axiosConfig = { | |
headers: { | |
'Content-Type': 'application/json', | |
"Access-Control-Allow-Origin": "*", | |
} | |
}; | |
uid = axios.post(url, msg, axiosConfig) | |
.then(function (response) { | |
console.log('uid is ', response.data.instance_id); | |
return response.data.instance_id | |
}) | |
.catch(function (error) { | |
console.log("error", error); | |
}); | |
console.log("uid here is ", uid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment