Skip to content

Commit 6c19668

Browse files
committed
Changed http put to Http post for REST import
1 parent ecb8f1e commit 6c19668

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public Response exportNoteBook(@PathParam("id") String noteId) {
173173
* @return JSON with new note ID
174174
* @throws IOException
175175
*/
176-
@PUT
176+
@POST
177177
@Path("import")
178178
public Response importNotebook(String req) {
179179
GsonBuilder gsonBuilder = new GsonBuilder();

zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinRestApiTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,11 @@ public void testImportNotebook() throws IOException {
367367
String sourceNoteID = note.getId();
368368
// get note content as JSON
369369
String oldJson = getNoteContent(sourceNoteID);
370-
// call notebook put
371-
PutMethod importPut = httpPut("/notebook/import/", oldJson);
372-
assertThat(importPut, isCreated());
370+
// call notebook post
371+
PostMethod importPost = httpPost("/notebook/import/", oldJson);
372+
assertThat(importPost, isCreated());
373373
resp =
374-
gson.fromJson(importPut.getResponseBodyAsString(),
374+
gson.fromJson(importPost.getResponseBodyAsString(),
375375
new TypeToken<Map<String, Object>>() {}.getType());
376376
String importId = (String) resp.get("body");
377377

@@ -383,7 +383,7 @@ public void testImportNotebook() throws IOException {
383383
// cleanup
384384
ZeppelinServer.notebook.removeNote(note.getId());
385385
ZeppelinServer.notebook.removeNote(newNote.getId());
386-
importPut.releaseConnection();
386+
importPost.releaseConnection();
387387
}
388388

389389
private String getNoteContent(String id) throws IOException {

0 commit comments

Comments
 (0)