python - Passing in login credentials when making REST calls using Restangular -


i writing application creates data via rest. example while using requests in python save patient

pt = requests.post('http://localhost:8080/openmrs/ws/rest/v1/patient',data=json.dumps(patientpayload),headers=headers,auth=httpbasicauth('myusername','mypassword')) 

how can 1 simulate using restangular these examples found not working

return restangular.all('user/session/authenticate').post({user_id: user_id, password: password}); 

or

var login = restangular.one('auth').custompost( {grant_type:'password', username:'b@t.com', password:'666666', scope:'app'}, 'token', {}, {     authorization:'basic ' + client,     contenttype:'application/x-www-form-urlencoded' } 

);


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -