File tree Expand file tree Collapse file tree 5 files changed +57
-1
lines changed
examples/httpbuilder-project Expand file tree Collapse file tree 5 files changed +57
-1
lines changed Original file line number Diff line number Diff line change 1+ # http://editorconfig.org
2+ root = true
3+
4+ [* ]
5+ indent_style = tab
6+ indent_size = 2
7+ end_of_line = lf
8+ charset = utf-8
9+ trim_trailing_whitespace = true
10+ insert_final_newline = true
11+
12+ [* .md ]
13+ trim_trailing_whitespace = false
14+
15+ [* .java ]
16+ indent_size = 4
Original file line number Diff line number Diff line change @@ -27,4 +27,6 @@ examples/shell-project/.gradle
2727examples /shell-project /.settings
2828examples /shell-project /.project
2929examples /shell-project /.classpath
30- examples /minimal-project /.gradle
30+ examples /minimal-project /.gradle
31+ .idea
32+ * .iml
Original file line number Diff line number Diff line change 1+ buildscript {
2+ dependencies {
3+ classpath ' org.codehaus.groovy.modules.http-builder:http-builder:0.7'
4+ }
5+ }
6+
7+ plugins {
8+ id " com.marklogic.ml-gradle" version " 2.1.0"
9+ }
10+
11+ /*
12+ * This shows an example of using RESTClient - https://github.com/jgritman/httpbuilder/wiki/RESTClient - to talk to
13+ * our REST API server.
14+ */
15+ task httpTest {
16+ doLast {
17+ def client = new groovyx.net.http.RESTClient (" http://" + mlHost + " :" + mlRestPort)
18+ client. auth. basic mlUsername, mlPassword
19+
20+ println client. get(path : ' /' ). data
21+ }
22+ }
23+
24+ /*
25+ * You can also easily get an instance of a MarkLogic DatabaseClient (part of the Java API) for talking to the REST
26+ * API server.
27+ */
28+ task clientTest (type : com.marklogic.gradle.task.MarkLogicTask ) {
29+ doLast {
30+ def client = newClient()
31+ println " DatabaseClient: " + client
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ mlHost =localhost
2+ mlAppName =httpbuilder-project
3+ mlRestPort =8130
4+ mlUsername =admin
5+ mlPassword =admin
You can’t perform that action at this time.
0 commit comments