Skip to content

Commit 9987c66

Browse files
committed
Update Http.java
1 parent 3c197ac commit 9987c66

File tree

1 file changed

+13
-3
lines changed
  • src/main/java/io/github/jeemv/springboot/vuejs/utilities

1 file changed

+13
-3
lines changed

src/main/java/io/github/jeemv/springboot/vuejs/utilities/Http.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Http class for Http requests
77
*
88
* @author jcheron myaddressmail@gmail.com
9-
* @version 1.0.5
9+
* @version 1.0.6
1010
*/
1111
public class Http {
1212

@@ -358,14 +358,24 @@ public static String post(String url, String successCallback) {
358358
}
359359

360360
/**
361-
* Defines a request header
361+
* Defines a request header.
362362
*
363363
* @param key the header key
364364
* @param value the header value
365-
* @return
365+
* @return the javascript generated
366366
*/
367367
public static String setRequestHeader(String key, String value) {
368368
return "this.$http.headers.set('" + key + "', '" + value + "');";
369369
}
370370

371+
/**
372+
* Adds response.data to an array.
373+
*
374+
* @param array the array to update
375+
* @return the javascript generated
376+
*/
377+
public String responseToArray(String array) {
378+
return JsArray.add(array, RESPONSE_DATA);
379+
}
380+
371381
}

0 commit comments

Comments
 (0)