Commit 5a5e0fe5 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Remove json post

parent 6943d938
...@@ -46,7 +46,7 @@ public class UserScriptController { ...@@ -46,7 +46,7 @@ public class UserScriptController {
@Autowired @Autowired
private UserScriptDao dao; private UserScriptDao dao;
// curl -v -X POST -F "file=@.ssh/id_dsa.pub" localhost:8080/drip-api/rest/user_script/upload // curl -v -X POST -F "file=@script.sh" localhost:8080/drip-api/rest/user_script/upload
@RequestMapping(value = "/upload", method = RequestMethod.POST) @RequestMapping(value = "/upload", method = RequestMethod.POST)
public @ResponseBody public @ResponseBody
String uploadUserScript(@RequestParam("file") MultipartFile file) throws JSONException { String uploadUserScript(@RequestParam("file") MultipartFile file) throws JSONException {
...@@ -70,16 +70,15 @@ public class UserScriptController { ...@@ -70,16 +70,15 @@ public class UserScriptController {
} }
return null; return null;
} }
// curl -H "Content-Type: application/json" -X POST -d '{"key":"ssh-rsa AAAAB3NzaDWBqs75i849MytgwgQcRYMcsXIki0yeYTKABH6JqoiyFBHtYlyh/EV1t6cujb9LyNP4J5EN4fPbtwKYvxecd0LojSPxl4wjQlfrHyg6iKUYB7hVzGqACMvgYZHrtHPfrdEmOGPplPVPpoaX2j+u0BZ0yYhrWMKjzyYZKa68yy5N18+Gq+1p83HfUDwIU9wWaUYdgEvDujqF6b8p3z6LDx9Ob+RanSMZSt+b8eZRcd+F2Oy/gieJEJ8kc152VIOv8UY1xB3hVEwVnSRGgrAsa+9PChfF6efXUGWiKf8KBlWgBOYsSTsOY4ks9zkXMnbcTdC+o7xspOkyIcWjv us@u\n","name":"id_rsa.pub"}' localhost:8080/drip-api/rest/user_key/ // @RequestMapping(method = RequestMethod.POST)
@RequestMapping(method = RequestMethod.POST) // public @ResponseBody
public @ResponseBody // String postConf(UserScript us) {
String postConf(UserScript us) { // String name = System.currentTimeMillis() + "_" + us.getName();
String name = System.currentTimeMillis() + "_" + us.getName(); // us.setName(name);
us.setName(name); // dao.save(us);
dao.save(us); // return us.getId();
return us.getId(); // }
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET) @RequestMapping(value = "/{id}", method = RequestMethod.GET)
public UserScript get(@PathVariable("id") String id) { public UserScript get(@PathVariable("id") String id) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment