httputil.DumpRequest works like a charm if you would like to dump an HTTP request to its string representation in order to, say, tell precisely what information a front-end application sends to a back-end application. It takes into consideration regenerating an exact same body if it's instructed to dump the body (the second parameter), keeping subsequent operations intact.
没有评论:
发表评论