Skip to content

Instantly share code, notes, and snippets.

@markroxor
Created September 2, 2018 14:53
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 markroxor/8b3150164cbe58ca7d4f069ec0383076 to your computer and use it in GitHub Desktop.
Save markroxor/8b3150164cbe58ca7d4f069ec0383076 to your computer and use it in GitHub Desktop.
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