@openfn/language-http 7.0.2 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ast.json +7 -2
- package/package.json +1 -1
- package/types/Adaptor.d.ts +8 -2
package/ast.json
CHANGED
|
@@ -17,9 +17,14 @@
|
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"title": "example",
|
|
20
|
-
"description": "request('GET', '/patient', {\n query: { foo: 'bar', a: 1 },\n
|
|
20
|
+
"description": "request('GET', '/patient', {\n query: { foo: 'bar', a: 1 },\n});",
|
|
21
21
|
"caption": "Make a GET request"
|
|
22
22
|
},
|
|
23
|
+
{
|
|
24
|
+
"title": "example",
|
|
25
|
+
"description": "request('POST', '/todos', {\n body:{\n \"userId\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n },\n});",
|
|
26
|
+
"caption": "Make a POST request with a body"
|
|
27
|
+
},
|
|
23
28
|
{
|
|
24
29
|
"title": "function",
|
|
25
30
|
"description": null,
|
|
@@ -84,7 +89,7 @@
|
|
|
84
89
|
},
|
|
85
90
|
{
|
|
86
91
|
"title": "example",
|
|
87
|
-
"description": "get('/patient', {\n query: { foo: 'bar', a: 1 },\n
|
|
92
|
+
"description": "get('/patient', {\n query: { foo: 'bar', a: 1 },\n});",
|
|
88
93
|
"caption": "GET request with query parameters and custom headers"
|
|
89
94
|
},
|
|
90
95
|
{
|
package/package.json
CHANGED
package/types/Adaptor.d.ts
CHANGED
|
@@ -36,7 +36,14 @@ export function execute(...operations: Operations): Operation;
|
|
|
36
36
|
* @example <caption>Make a GET request</caption>
|
|
37
37
|
* request('GET', '/patient', {
|
|
38
38
|
* query: { foo: 'bar', a: 1 },
|
|
39
|
-
*
|
|
39
|
+
* });
|
|
40
|
+
* @example <caption>Make a POST request with a body</caption>
|
|
41
|
+
* request('POST', '/todos', {
|
|
42
|
+
* body:{
|
|
43
|
+
* "userId": 1,
|
|
44
|
+
* "title": "delectus aut autem",
|
|
45
|
+
* "completed": false
|
|
46
|
+
* },
|
|
40
47
|
* });
|
|
41
48
|
* @function
|
|
42
49
|
* @param {string} method - The HTTP method to use.
|
|
@@ -52,7 +59,6 @@ export function request(method: string, path: string, options: RequestOptions):
|
|
|
52
59
|
* @example <caption>GET request with query parameters and custom headers</caption>
|
|
53
60
|
* get('/patient', {
|
|
54
61
|
* query: { foo: 'bar', a: 1 },
|
|
55
|
-
* headers: { 'content-type': 'application/json' },
|
|
56
62
|
* });
|
|
57
63
|
* @function
|
|
58
64
|
* @param {string} path - Path to resource. Can be an absolute URL if baseURL is NOT set on `state.configuration`.
|