Skip to content

Commit 1b77c32

Browse files
committed
feat: added create functions for http request/response and status code
1 parent 950d8c5 commit 1b77c32

File tree

6 files changed

+469
-4
lines changed

6 files changed

+469
-4
lines changed

definitions/http/data_type/object/http_request_object.json renamed to definitions/http/data_type/object/http_request.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"variant": 3,
3-
"identifier": "HTTP_REQUEST_OBJECT",
3+
"identifier": "HTTP_REQUEST",
44
"name": [
55
{
66
"code": "en-US",

definitions/http/data_type/object/http_response_object.json renamed to definitions/http/data_type/object/http_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"variant": 3,
3-
"identifier": "HTTP_RESPONSE_OBJECT",
3+
"identifier": "HTTP_RESPONSE",
44
"name": [
55
{
66
"code": "en-US",
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
{
2+
"variant": 2,
3+
"identifier": "HTTP_STATUS_CODE",
4+
"name": [
5+
{
6+
"code": "en-US",
7+
"content": "HTTP Status Code"
8+
}
9+
],
10+
"rules": [
11+
{
12+
"config": {
13+
"ItemOfCollection": {
14+
"items": [
15+
{
16+
"kind": { "StringValue": "100 Continue" }
17+
},
18+
{
19+
"kind": { "StringValue": "101 Switching Protocols" }
20+
},
21+
{
22+
"kind": { "StringValue": "102 Processing" }
23+
},
24+
{
25+
"kind": { "StringValue": "103 Early Hints" }
26+
},
27+
{
28+
"kind": { "StringValue": "200 OK" }
29+
},
30+
{
31+
"kind": { "StringValue": "201 Created" }
32+
},
33+
{
34+
"kind": { "StringValue": "202 Accepted" }
35+
},
36+
{
37+
"kind": { "StringValue": "203 Non-Authoritative Information" }
38+
},
39+
{
40+
"kind": { "StringValue": "204 No Content" }
41+
},
42+
{
43+
"kind": { "StringValue": "205 Reset Content" }
44+
},
45+
{
46+
"kind": { "StringValue": "206 Partial Content" }
47+
},
48+
{
49+
"kind": { "StringValue": "207 Multi-Status" }
50+
},
51+
{
52+
"kind": { "StringValue": "208 Already Reported" }
53+
},
54+
{
55+
"kind": { "StringValue": "226 IM Used" }
56+
},
57+
{
58+
"kind": { "StringValue": "300 Multiple Choices" }
59+
},
60+
{
61+
"kind": { "StringValue": "301 Moved Permanently" }
62+
},
63+
{
64+
"kind": { "StringValue": "302 Found" }
65+
},
66+
{
67+
"kind": { "StringValue": "303 See Other" }
68+
},
69+
{
70+
"kind": { "StringValue": "304 Not Modified" }
71+
},
72+
{
73+
"kind": { "StringValue": "305 Use Proxy" }
74+
},
75+
{
76+
"kind": { "StringValue": "306 Switch Proxy" }
77+
},
78+
{
79+
"kind": { "StringValue": "307 Temporary Redirect" }
80+
},
81+
{
82+
"kind": { "StringValue": "308 Permanent Redirect" }
83+
},
84+
{
85+
"kind": { "StringValue": "400 Bad Request" }
86+
},
87+
{
88+
"kind": { "StringValue": "401 Unauthorized" }
89+
},
90+
{
91+
"kind": { "StringValue": "402 Payment Required" }
92+
},
93+
{
94+
"kind": { "StringValue": "403 Forbidden" }
95+
},
96+
{
97+
"kind": { "StringValue": "404 Not Found" }
98+
},
99+
{
100+
"kind": { "StringValue": "405 Method Not Allowed" }
101+
},
102+
{
103+
"kind": { "StringValue": "406 Not Acceptable" }
104+
},
105+
{
106+
"kind": { "StringValue": "407 Proxy Authentication Required" }
107+
},
108+
{
109+
"kind": { "StringValue": "408 Request Timeout" }
110+
},
111+
{
112+
"kind": { "StringValue": "409 Conflict" }
113+
},
114+
{
115+
"kind": { "StringValue": "410 Gone" }
116+
},
117+
{
118+
"kind": { "StringValue": "411 Length Required" }
119+
},
120+
{
121+
"kind": { "StringValue": "412 Precondition Failed" }
122+
},
123+
{
124+
"kind": { "StringValue": "413 Payload Too Large" }
125+
},
126+
{
127+
"kind": { "StringValue": "414 URI Too Long" }
128+
},
129+
{
130+
"kind": { "StringValue": "415 Unsupported Media Type" }
131+
},
132+
{
133+
"kind": { "StringValue": "416 Range Not Satisfiable" }
134+
},
135+
{
136+
"kind": { "StringValue": "417 Expectation Failed" }
137+
},
138+
{
139+
"kind": { "StringValue": "418 I'm a teapot" }
140+
},
141+
{
142+
"kind": { "StringValue": "421 Misdirected Request" }
143+
},
144+
{
145+
"kind": { "StringValue": "422 Unprocessable Entity" }
146+
},
147+
{
148+
"kind": { "StringValue": "423 Locked" }
149+
},
150+
{
151+
"kind": { "StringValue": "424 Failed Dependency" }
152+
},
153+
{
154+
"kind": { "StringValue": "425 Too Early" }
155+
},
156+
{
157+
"kind": { "StringValue": "426 Upgrade Required" }
158+
},
159+
{
160+
"kind": { "StringValue": "428 Precondition Required" }
161+
},
162+
{
163+
"kind": { "StringValue": "429 Too Many Requests" }
164+
},
165+
{
166+
"kind": { "StringValue": "431 Request Header Fields Too Large" }
167+
},
168+
{
169+
"kind": { "StringValue": "451 Unavailable For Legal Reasons" }
170+
},
171+
{
172+
"kind": { "StringValue": "500 Internal Server Error" }
173+
},
174+
{
175+
"kind": { "StringValue": "501 Not Implemented" }
176+
},
177+
{
178+
"kind": { "StringValue": "502 Bad Gateway" }
179+
},
180+
{
181+
"kind": { "StringValue": "503 Service Unavailable" }
182+
},
183+
{
184+
"kind": { "StringValue": "504 Gateway Timeout" }
185+
},
186+
{
187+
"kind": { "StringValue": "505 HTTP Version Not Supported" }
188+
},
189+
{
190+
"kind": { "StringValue": "506 Variant Also Negotiates" }
191+
},
192+
{
193+
"kind": { "StringValue": "507 Insufficient Storage" }
194+
},
195+
{
196+
"kind": { "StringValue": "508 Loop Detected" }
197+
},
198+
{
199+
"kind": { "StringValue": "510 Not Extended" }
200+
},
201+
{
202+
"kind": { "StringValue": "511 Network Authentication Required" }
203+
}
204+
]
205+
}
206+
}
207+
}
208+
],
209+
"generic_keys": []
210+
}

definitions/http/flow_type/http.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"identifier": "HTTP",
33
"settings": [],
4-
"input_type_identifier": "HTTP_REQUEST_OBJECT",
5-
"return_type_identifier": "HTTP_RESPONSE_OBJECT",
4+
"input_type_identifier": "HTTP_REQUEST",
5+
"return_type_identifier": "HTTP_RESPONSE",
66
"editable": false,
77
"name": [
88
{
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
{
2+
"runtime_name": "http::request::create",
3+
"runtime_parameter_definitions": [
4+
{
5+
"data_type_identifier": {
6+
"type": {
7+
"DataTypeIdentifier": "HTTP_METHOD"
8+
}
9+
},
10+
"runtime_name": "http_method",
11+
"default_value": null,
12+
"name": [
13+
{
14+
"code": "en-US",
15+
"content": "HTTP Method"
16+
}
17+
],
18+
"description": [
19+
{
20+
"code": "en-US",
21+
"content": "Defines the HTTP method to be used, such as GET, POST, PUT, or DELETE."
22+
}
23+
],
24+
"documentation": [
25+
{
26+
"code": "en-US",
27+
"content": "Specifies the request method that determines the type of HTTP operation to perform."
28+
}
29+
]
30+
},
31+
{
32+
"data_type_identifier": {
33+
"type": {
34+
"DataTypeIdentifier": "HTTP_HEADER_MAP"
35+
}
36+
},
37+
"runtime_name": "headers",
38+
"default_value": null,
39+
"name": [
40+
{
41+
"code": "en-US",
42+
"content": "HTTP Headers"
43+
}
44+
],
45+
"description": [
46+
{
47+
"code": "en-US",
48+
"content": "A collection of key-value pairs containing additional request metadata."
49+
}
50+
],
51+
"documentation": [
52+
{
53+
"code": "en-US",
54+
"content": "Optional headers that can define content type, authorization, cookies, caching policies, and more."
55+
}
56+
]
57+
},
58+
{
59+
"data_type_identifier": {
60+
"type": {
61+
"DataTypeIdentifier": "HTTP_URL"
62+
}
63+
},
64+
"runtime_name": "url",
65+
"default_value": null,
66+
"name": [
67+
{
68+
"code": "en-US",
69+
"content": "Request URL"
70+
}
71+
],
72+
"description": [
73+
{
74+
"code": "en-US",
75+
"content": "The target URL to which the HTTP request will be sent."
76+
}
77+
],
78+
"documentation": [
79+
{
80+
"code": "en-US",
81+
"content": "Specifies the endpoint address, including protocol, host, path, and query parameters, where the request is directed."
82+
}
83+
]
84+
},
85+
{
86+
"data_type_identifier": {
87+
"type": {
88+
"GenericKey": "P"
89+
}
90+
},
91+
"runtime_name": "payload",
92+
"default_value": null,
93+
"name": [
94+
{
95+
"code": "en-US",
96+
"content": "Request Body"
97+
}
98+
],
99+
"description": [
100+
{
101+
"code": "en-US",
102+
"content": "The data to include in the body of the request, typically used with methods like POST or PUT."
103+
}
104+
],
105+
"documentation": [
106+
{
107+
"code": "en-US",
108+
"content": "Contains the request payload, such as JSON, XML, form data, or binary content, depending on the Content-Type header."
109+
}
110+
]
111+
}
112+
],
113+
"return_type_identifier": {
114+
"type": {
115+
"DataTypeIdentifier": "HTTP_REQUEST"
116+
}
117+
},
118+
"throws_error": false,
119+
"generic_keys": [
120+
"P"
121+
],
122+
"name": [
123+
{
124+
"code": "en-US",
125+
"content": "Construct HTTP Request"
126+
}
127+
],
128+
"description": [
129+
{
130+
"code": "en-US",
131+
"content": "Constructs an HTTP request object using the specified method, headers, URL, and payload."
132+
}
133+
],
134+
"documentation": [
135+
{
136+
"code": "en-US",
137+
"content": "Generates an HTTP request object that can be sent to a server. The request includes an HTTP method, optional headers, a destination URL, and an optional request body."
138+
}
139+
],
140+
"deprecation_message": []
141+
}

0 commit comments

Comments
 (0)