Hisoka-X commented on code in PR #9184:
URL: https://github.com/apache/seatunnel/pull/9184#discussion_r2067738970
##########
docs/en/connector-v2/source/Http.md:
##########
@@ -402,9 +415,140 @@ source {
}
}
}
+```
+
+##### Example 2: Using page parameters in headers
+
+```hocon
+source {
+ Http {
+ url = "http://localhost:8080/mock/queryData"
+ method = "GET"
+ format = "json"
+ headers={
+ Page-Number = "${pageNo}"
+ Authorization = "Bearer token-123"
+ }
+ pageing={
+ page_field = pageNo
+ start_page_number = 1
+ batch_size = 10
+ use_placeholder_replacement = true
+ }
+ schema = {
+ fields {
+ name = string
+ age = string
+ }
+ }
+ }
+}
+```
+
+#### Example 3: Using key-based replacement (without placeholders)
+
+```hocon
+source {
+ Http {
+ url = "http://localhost:8080/mock/queryData"
+ method = "GET"
+ format = "json"
+ params={
+ page = "1"
+ }
+ pageing={
+ page_field = page
+ start_page_number = 1
+ batch_size = 10
+ use_placeholder_replacement = false
+ }
+ schema = {
+ fields {
+ name = string
+ age = string
+ }
+ }
+ }
+}
+```
+#### Example 4: Using prefixed page number in headers
Review Comment:
```suggestion
##### Example 4: Using prefixed page number in headers
```
##########
docs/en/connector-v2/source/Http.md:
##########
@@ -402,9 +415,140 @@ source {
}
}
}
+```
+
+##### Example 2: Using page parameters in headers
+
+```hocon
+source {
+ Http {
+ url = "http://localhost:8080/mock/queryData"
+ method = "GET"
+ format = "json"
+ headers={
+ Page-Number = "${pageNo}"
+ Authorization = "Bearer token-123"
+ }
+ pageing={
+ page_field = pageNo
+ start_page_number = 1
+ batch_size = 10
+ use_placeholder_replacement = true
+ }
+ schema = {
+ fields {
+ name = string
+ age = string
+ }
+ }
+ }
+}
+```
+
+#### Example 3: Using key-based replacement (without placeholders)
+
+```hocon
+source {
+ Http {
+ url = "http://localhost:8080/mock/queryData"
+ method = "GET"
+ format = "json"
+ params={
+ page = "1"
+ }
+ pageing={
+ page_field = page
+ start_page_number = 1
+ batch_size = 10
+ use_placeholder_replacement = false
+ }
+ schema = {
+ fields {
+ name = string
+ age = string
+ }
+ }
+ }
+}
+```
+#### Example 4: Using prefixed page number in headers
-```
+```hocon
+source {
+ Http {
+ url = "http://localhost:8080/mock/queryData"
+ method = "GET"
+ format = "json"
+ headers = {
+ Page-Number = "10${page}" # Will become "105" when page=5
+ Authorization = "Bearer token-123"
+ }
+ pageing = {
+ page_field = page
+ start_page_number = 5
+ batch_size = 10
+ use_placeholder_replacement = true
+ }
+ schema = {
+ fields {
+ name = string
+ age = string
+ }
+ }
+ }
+}
+```
+
+#### Example 5: Using unquoted page number in body
+
+```hocon
+source {
+ Http {
+ url = "http://localhost:8080/mock/queryData"
+ method = "POST"
+ format = "json"
+ body = """{"a":${page},"limit":10}""" # Unquoted number
+ pageing = {
+ page_field = page
+ start_page_number = 1
+ batch_size = 10
+ use_placeholder_replacement = true
+ }
+ schema = {
+ fields {
+ name = string
+ age = string
+ }
+ }
+ }
+}
+```
+
+#### Example 6: Using nested JSON structure with page parameter
Review Comment:
```suggestion
##### Example 6: Using nested JSON structure with page parameter
```
##########
docs/en/connector-v2/source/Http.md:
##########
@@ -402,9 +415,140 @@ source {
}
}
}
+```
+
+##### Example 2: Using page parameters in headers
+
+```hocon
+source {
+ Http {
+ url = "http://localhost:8080/mock/queryData"
+ method = "GET"
+ format = "json"
+ headers={
+ Page-Number = "${pageNo}"
+ Authorization = "Bearer token-123"
+ }
+ pageing={
+ page_field = pageNo
+ start_page_number = 1
+ batch_size = 10
+ use_placeholder_replacement = true
+ }
+ schema = {
+ fields {
+ name = string
+ age = string
+ }
+ }
+ }
+}
+```
+
+#### Example 3: Using key-based replacement (without placeholders)
Review Comment:
```suggestion
##### Example 3: Using key-based replacement (without placeholders)
```
##########
docs/en/connector-v2/source/Http.md:
##########
@@ -402,9 +415,140 @@ source {
}
}
}
+```
+
+##### Example 2: Using page parameters in headers
+
+```hocon
+source {
+ Http {
+ url = "http://localhost:8080/mock/queryData"
+ method = "GET"
+ format = "json"
+ headers={
+ Page-Number = "${pageNo}"
+ Authorization = "Bearer token-123"
+ }
+ pageing={
+ page_field = pageNo
+ start_page_number = 1
+ batch_size = 10
+ use_placeholder_replacement = true
+ }
+ schema = {
+ fields {
+ name = string
+ age = string
+ }
+ }
+ }
+}
+```
+
+#### Example 3: Using key-based replacement (without placeholders)
+
+```hocon
+source {
+ Http {
+ url = "http://localhost:8080/mock/queryData"
+ method = "GET"
+ format = "json"
+ params={
+ page = "1"
+ }
+ pageing={
+ page_field = page
+ start_page_number = 1
+ batch_size = 10
+ use_placeholder_replacement = false
+ }
+ schema = {
+ fields {
+ name = string
+ age = string
+ }
+ }
+ }
+}
+```
+#### Example 4: Using prefixed page number in headers
-```
+```hocon
+source {
+ Http {
+ url = "http://localhost:8080/mock/queryData"
+ method = "GET"
+ format = "json"
+ headers = {
+ Page-Number = "10${page}" # Will become "105" when page=5
+ Authorization = "Bearer token-123"
+ }
+ pageing = {
+ page_field = page
+ start_page_number = 5
+ batch_size = 10
+ use_placeholder_replacement = true
+ }
+ schema = {
+ fields {
+ name = string
+ age = string
+ }
+ }
+ }
+}
+```
+
+#### Example 5: Using unquoted page number in body
Review Comment:
```suggestion
##### Example 5: Using unquoted page number in body
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]