You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find that when calling ctx.Bind multi times, different params show different behaviors.
Cases:
PathParams can be bind multi times.
QueryParams can be bind multi times.
FormParams can be bind multi times. (Content-Type == "application/x-www-form-urlencoded" || Content-Type == "application/form-data")
JsonParams can only be bind once.(Content-Type == "application/json")
XmlParams can only be bind once.(Content-Type == "application/xml")
Reason
As metioned in related issues, request body as io.Reader will be consumed after reading.
Thinking(Important)
I think it's something about definition of Content#Bind method. It(Bind method) did two different things in above cases.
In case 1,2,3, Bind method Bind params from context.pnames, content.pvalues, request.URL.Query(), request.Form which are idempotent in multiple calling.
In case 4,5, Bind method read data from request body, and unmarshal to target interface{}.
Will it be possible to do a data temp saving in content(like path params) in case 4,5, or restore data to request.Body after binding.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Uh oh!
There was an error while loading. Please reload this page.
Issue Description
I find that when calling
ctx.Bind
multi times, different params show different behaviors.Cases:
Content-Type == "application/x-www-form-urlencoded" || Content-Type == "application/form-data"
)Content-Type == "application/json"
)Content-Type == "application/xml"
)Reason
As metioned in related issues, request body as io.Reader will be consumed after reading.
Thinking(Important)
I think it's something about definition of
Content#Bind
method. It(Bind method) did two different things in above cases.context.pnames
,content.pvalues
,request.URL.Query()
,request.Form
which are idempotent in multiple calling.Will it be possible to do a data temp saving in content(like path params) in case 4,5, or restore data to request.Body after binding.
Checklist
Related Issues
#976, #782
The text was updated successfully, but these errors were encountered: