-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gf/net/gclient: The DoRequestObj function does not process the query parameters on non-GET requests #3861
Comments
|
|
@wwwfeng 我知道改成get是会去处理查询的参数,但是我现在遇到的情况是需要post/put/patch这三类 |
@wwwfeng I know that changing to get will process the query parameters, but the situation I am encountering now requires post/put/patch. |
我看着这个DoRequestObj的注释上也说 |
你好,目前 |
Hello, currently |
你好,我在修改现有DoRequestObj 支持这个issues,我个人希望直接使用规范路由请求体作为DoRequestObj的参数,这样方便大家在微服务远程调用中直接使用请求目标项目的req entity,现在其中关于上传文件这部分,现有DoRequestObj底层和其他request一样的 |
Hello, I am modifying the existing DoRequestObj to support this issue. I personally hope to directly use the canonical routing request body as the parameter of DoRequestObj. This will make it easier for everyone to directly use the req entity of the request target project in the microservice remote call. Now it is about uploading files. In this part, the existing DoRequestObj underlying |
Go version
go version go1.22.7 darwin/amd64
GoFrame version
2.7.4
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
Now URL
Expect URL
What did you see happen?
Query parameters (http://xxxx.com?code=11) are built only if content-type is not
application/json
andapplication/xml
.I think it would be more rigorous for the user to tag the fields in request struct to mark the parameter types (query parameters /json/ path parameters).
These tags are not handled in the current logic, and I'm not sure if this is for some special reason or if you want users to handle the logic themselves. If there is no special reason, I am ready to submit PR to implement my idea
What did you expect to see?
Now URL
Expect URL
The text was updated successfully, but these errors were encountered: