You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "chenliejun (via GitHub)" <gi...@apache.org> on 2025/01/03 01:24:21 UTC
[I] [Bug] [Http Source Connector v2] Post request with `application/json` body doesn't work for paging Because of paging info was set as `params` which add header `application/x-www-form-urlencoded` [seatunnel]
chenliejun opened a new issue, #8431:
URL: https://github.com/apache/seatunnel/issues/8431
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
### What happened
I want to pull data from http via post request with body and paging like:
{
"pageIndex":1,
"pageSize":10,
"condition":{
"groupOp":"and",
"rules":[{
"field":"HTLX",
"op":"li",
"data":"xxx"
}
]
}
}
the `pageIndex` as the pageing.page_field to increment auto,as:1,2,3...
with the conf below got Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported,Because the server only support `application/json` as request body.
I review the Seatunnel dev branch source code ,And find the paging info has been treated as request params (UrlEncodedFormEntity)which add header “Content-Type :application/x-www-form-urlencoded;charset=UTF-8”
### SeaTunnel Version
2.3.8
### SeaTunnel Config
```conf
env {
parallelism = 1
job.mode = "BATCH"
job.name = "chen_http_json"
checkpoint.interval = 10000
}
source {
Http {
result_table_name = "step1"
plugin_output = "http"
url = "http://10.24.73.96/api/query/httpsjon"
method = "POST"
format = "json"
headers = {
"Authorization":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI0MGRkOWE4NmQ1OGNkMjNjMjgwOTNlMzY5NTE0MGJhNiIsIm5hbWUiOiJjaGVuIiwic2VjcmVjeUxldmVsIjozLCJyb2xlIjoibGVhZGVyIiwianRpIjoiQjZCODgyNUFFNDExNDFGOUJGRTczRDZEOTZFMUNFMDIiLCJpc3MiOiJjaGVuIiwiZXhwIjoxNzM0NTczNjM0LCJuYmYiOjE3MzQ1NzAwMzR9.xBi-5djUCz3o0T1na9RxKJN32MXIXQ2mkPReUIl5UDA"
}
body = "{\"pageIndex\":\"${pageIndex}\",\"pageSize\":10,\"condition\":{\"groupOp\":\"and\",\"rules\":[{\"field\":\"HTLX\",\"op\":\"li\",\"data\":\"合同\"}]}}"
content_field = "$.data.list.*"
pageing={
page_field = pageIndex
start_page_number = 2
batch_size = 10
}
schema = {
fields {
HTID = string
KHID = string
HTLX = string
ZCRQ = timestamp
SFYJJH = string
}
}
}
}
sink {
Jdbc {
source_table_name = "step1"
url = "jdbc:mysql://xxxx:3307/chen_test?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false"
driver = "com.mysql.cj.jdbc.Driver"
max_retries = 0
user = "root"
password = "xxxx"
generate_sink_sql = true
database = chen_test
table = new_slsj
}
}
```
### Running Command
```shell
seatunnel.sh -c $SEATUNNEL_HOME/scripts/chen_http_json.conf -n chen_http_json
```
### Error Exception
```log
the http server shows: ERROR [xxx]-Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported
```
### Zeta or Flink or Spark Version
Zeta
### Java or Scala Version
Java 17
### Screenshots
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
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: commits-unsubscribe@seatunnel.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [Http Source Connector v2] Post request with `application/json` body doesn't work for paging Because of paging info was set as `params` which add header `application/x-www-form-urlencoded` [seatunnel]
Posted by "wu-a-ge (via GitHub)" <gi...@apache.org>.
wu-a-ge commented on issue #8431:
URL: https://github.com/apache/seatunnel/issues/8431#issuecomment-2568805861
This function is badly designed and cannot be used in at least 80% of the current business scenarios
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [Http Source Connector v2] Post request with `application/json` body doesn't work for paging Because of paging info was set as `params` which add header `application/x-www-form-urlencoded` [seatunnel]
Posted by "chenliejun (via GitHub)" <gi...@apache.org>.
chenliejun commented on issue #8431:
URL: https://github.com/apache/seatunnel/issues/8431#issuecomment-2568660561
But it's really an common requirement,can the team take it as an new feature in the next version?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [Http Source Connector v2] Post request with `application/json` body doesn't work for paging Because of paging info was set as `params` which add header `application/x-www-form-urlencoded` [seatunnel]
Posted by "CosmosNi (via GitHub)" <gi...@apache.org>.
CosmosNi commented on issue #8431:
URL: https://github.com/apache/seatunnel/issues/8431#issuecomment-2568655138
Pagination in body is not supported yet.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [Http Source Connector v2] Post request with `application/json` body doesn't work for paging Because of paging info was set as `params` which add header `application/x-www-form-urlencoded` [seatunnel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #8431: [Bug] [Http Source Connector v2] Post request with `application/json` body doesn't work for paging Because of paging info was set as `params` which add header `application/x-www-form-urlencoded`
URL: https://github.com/apache/seatunnel/issues/8431
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [Http Source Connector v2] Post request with `application/json` body doesn't work for paging Because of paging info was set as `params` which add header `application/x-www-form-urlencoded` [seatunnel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8431:
URL: https://github.com/apache/seatunnel/issues/8431#issuecomment-2652361870
This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [Http Source Connector v2] Post request with `application/json` body doesn't work for paging Because of paging info was set as `params` which add header `application/x-www-form-urlencoded` [seatunnel]
Posted by "CosmosNi (via GitHub)" <gi...@apache.org>.
CosmosNi commented on issue #8431:
URL: https://github.com/apache/seatunnel/issues/8431#issuecomment-2568662117
This can be discussed.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [Http Source Connector v2] Post request with `application/json` body doesn't work for paging Because of paging info was set as `params` which add header `application/x-www-form-urlencoded` [seatunnel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8431:
URL: https://github.com/apache/seatunnel/issues/8431#issuecomment-2629653444
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org