| 1 | When I do a POST to the experiment service, I can see that the user has been added to a project[[BR]] |
| 2 | But When I do |
| 3 | {{{ |
| 4 | curl http://emmy9.casa.umass.edu:8002/users/geni-dbhat/ |
| 5 | }}} |
| 6 | It does not list the project that I just added it to. |
| 7 | |
| 8 | If I do |
| 9 | {{{ |
| 10 | curl http://emmy9.casa.umass.edu:8002/projects/GIMITesting/users/ |
| 11 | }}} |
| 12 | I can see geni-dbhat in the list |
| 13 | |
| 14 | Here is the code in which I am creating the JSON: |
| 15 | |
| 16 | {{{ |
| 17 | def postUser(self): |
| 18 | data = [{'name': "geni-" + self.user_name}] |
| 19 | headers = {'Content-type': 'application/json', 'Accept': 'text/plain'} |
| 20 | #data=json.dumps(data) |
| 21 | json_filename = self.workdirectory + "/user.json" |
| 22 | print ("Saving JSON to file: " + json_filename) |
| 23 | jsonf = open(json_filename,'w') |
| 24 | data = json.dumps(data) |
| 25 | jsonf.write(data) |
| 26 | jsonf.close() |
| 27 | os.system('curl -X POST -H "Content-Type: application/json" --data-binary @'+ json_filename +' ' + self.restURL + ':' + str(self.restPort) + '/projects/' + self.proj_name + '/users') |
| 28 | |
| 29 | }}} |
| 30 | |
| 31 | The contents of my json file are: |
| 32 | |
| 33 | {{{ |
| 34 | [{"name": "geni-dbhat"}] |
| 35 | }}} |