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
Post a Comment