Skip to content

Commit 5a40343

Browse files
authored
Add HttpRequest and HttpResponse msg types (#2)
* add HttpRawRequest and HttpRawResponse msg types * Rename HTTP message types and improve comments - Rename HttpRawRequest/HttpRawResponse to HttpRequest/HttpResponse - Add detailed field documentation following polymath_msgs conventions - Remove misleading "logging" designation
1 parent 8362dc2 commit 5a40343

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ rosidl_generate_interfaces(${PROJECT_NAME}
4141
"msg/RouteNode.msg"
4242
"msg/RouteEdge.msg"
4343
"msg/Route.msg"
44+
"msg/HttpRequest.msg"
45+
"msg/HttpResponse.msg"
4446
"srv/FetchRouteNode.srv"
4547
"srv/ModifyRouteNode.srv"
4648
"srv/ModifyRouteEdge.srv"

msg/HttpRequest.msg

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# HTTP request message
2+
3+
# Standard ROS header
4+
std_msgs/Header header
5+
6+
# Unique identifier for this request
7+
string request_id
8+
9+
# HTTP method (GET, POST, PUT, DELETE, etc.)
10+
string method
11+
12+
# Request path (e.g. /v2/polymath-feedback)
13+
string path
14+
15+
# Query string parameters
16+
string query
17+
18+
# Size of the request body in bytes
19+
uint32 bytes
20+
21+
# HTTP headers as key-value pairs
22+
polymath_msgs/KeyValue[] headers
23+
24+
# Raw body data
25+
uint8[] body
26+
27+
# Body data as text (for non-binary content)
28+
string body_text

msg/HttpResponse.msg

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# HTTP response message
2+
3+
# Standard ROS header
4+
std_msgs/Header header
5+
6+
# Unique identifier matching the original request
7+
string request_id
8+
9+
# HTTP method from the original request
10+
string method
11+
12+
# Request path from the original request
13+
string path
14+
15+
# HTTP status code (200, 404, 500, etc.)
16+
uint16 status_code
17+
18+
# Size of the response body in bytes
19+
uint32 bytes
20+
21+
# Response time in milliseconds
22+
float64 duration_ms
23+
24+
# HTTP headers as key-value pairs
25+
polymath_msgs/KeyValue[] headers
26+
27+
# Raw body data
28+
uint8[] body
29+
30+
# Body data as text (for non-binary content)
31+
string body_text

0 commit comments

Comments
 (0)