-
Notifications
You must be signed in to change notification settings - Fork 464
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
hertz-curl: an adaption of http2curl for Hertz request #709
Comments
Sign. I don't think this is mentioned anywhere in the document. We should move at least one of the projects to hertz-contrib and add documentation and/or example for it. So people won't create a new fork in the future. |
I don't think // GetCurlCommand returns a CurlCommand corresponding to an http.Request
func GetCurlCommand(req *http.Request) (*CurlCommand, error) {
if req.URL == nil {
return nil, ErrorURINull
}
} The following change solves this problem. func GetCurlCommand(req *protocol.Request) (*Command, error) {
if req.URI().String() == "http:///" {
return nil, ErrRequestURINotSet
}
} |
thanks and won't be considered for now |
Is your feature request related to a problem? Please describe.
http2curl is a handy tool to convert http.Request to curl command, which is compact and supported by many API tools.
I used to convert protocol.Request to http.Request, then use http2curl to generate curl command, but this conversion is tedious and turns out to be expensive.
Describe the solution you'd like
In hertz-curl, adaption has been made for Hertz's request for two purposes:
Describe alternatives you've considered
This packages uses "curl" as its package name, which might conflict if users wish to use curl as a variable name.
We could use
hcurl
instead, but what the package does become less obvious.Additional context
None
The text was updated successfully, but these errors were encountered: