Skip to content

Commit f995e70

Browse files
authored
Fix documentation about queries with multiple parameters (#196)
- Fix the documentation about queries with multiple variables. The url with multiple variables needs quotation marks around the entire query in order to work. - Rearranged the "specified back-end" documentation since it is targeted for all endpoints.
1 parent 71c4e7d commit f995e70

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

wiki/markdown/curl-examples.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ The front-end may also be used by other tools such as CURL or any kind of progra
88
Below are some examples of using CURL towards different endpoints, together with example responses.
99
Most endpoints are also documented in the [Eiffel Intelligence backend repository](https://github.com/eiffel-community/eiffel-intelligence/tree/master/wiki/markdown)
1010

11+
**Note**: If you have multiple url parameters, you need to add quotation mark around the entire query. For example:
12+
13+
curl -X GET "http://localhost:8080/endpoint?varible1=1&varible2=2"
14+
1115
#### Quick access to endpoints:
1216
* [/auth](#auth)
1317
* [/backend](#backend)
@@ -17,6 +21,24 @@ Most endpoints are also documented in the [Eiffel Intelligence backend repositor
1721
* [/rules](#rules)
1822
* [/subscriptions](#subscriptions)
1923

24+
#### Specified back-end
25+
As a user of the front-end you may want to specify your own back-end URL if you do not want to use the default back-end.
26+
This is possible to do by injecting the back-end URL as a query parameter.
27+
The parameters key should be `backendurl` then enter the full HTTP URL you wish to use. This back-end instance does not have to be specified in the list of available instances.
28+
29+
An example of a way to add such parameter is examplified below, note that the "?" indicates that parameters has been added to the front-end url.
30+
`localhost:8080` is the front-end url, and we want to access the context path /auth but on URL `http://127.0.0.1:8090/` that is the back-end we wish to use.
31+
32+
33+
curl -X GET http://localhost:8080/auth?backendurl="http://127.0.0.1:8090/"
34+
35+
Example with Tomcat:
36+
37+
curl -X GET http://localhost:8080/eifrontend/auth?backendurl="http://127.0.0.1:8090/eibackend/"
38+
39+
This way of entering the `backendurl` may be the easiest way. It works with GET, POST and PUT requests. Currently entering just a back-end name is not supported.
40+
41+
**Note: It is not possible to add the `backendurl` parameter as a JSON parameter.**
2042

2143
## <a id="auth" /> /auth
2244

@@ -165,26 +187,6 @@ In the below command the JSON object is put in a file and sent along with the re
165187
curl -X DELETE --data @data.json localhost:8080/backend
166188

167189

168-
#### Specified back-end
169-
As a user of the front-end you may want to specify your own back-end URL if you do not want to use the default back-end.
170-
This is possible to do by injecting the back-end URL as a query parameter.
171-
The parameters key should be `backendurl` then enter the full HTTP URL you wish to use. This back-end instance does not have to be specified in the list of available instances.
172-
173-
An example of a way to add such parameter is below, note that the "?" indicates that parameters has been added to the front-end url.
174-
`localhost:8080` is the front-end url, and we want to access the context path /auth but on URL `http://127.0.0.1:8090/` that is the back-end we wish to use.
175-
176-
177-
curl -X GET http://localhost:8080/auth?backendurl="http://127.0.0.1:8090/"
178-
179-
Example with Tomcat:
180-
181-
curl -X GET http://localhost:8080/eifrontend/auth?backendurl="http://127.0.0.1:8090/eibackend/"
182-
183-
This way of entering the `backendurl` may be the easiest way. It works with GET, POST and PUT requests. Currently entering just a back-end name is not supported.
184-
185-
Note: It is not possible to add the `backendurl` parameter as a JSON parameter.
186-
187-
188190
## <a id="download" />/download
189191

190192
<table>

0 commit comments

Comments
 (0)