add more response types, form binding support, tls support#5
Merged
KARTIKrocks merged 2 commits intomainfrom Feb 24, 2026
Merged
add more response types, form binding support, tls support#5KARTIKrocks merged 2 commits intomainfrom
KARTIKrocks merged 2 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
BindForm[T]andBindFormWithConfig[T]forapplication/x-www-form-urlencodedbody binding with struct tags (form:"name")BindMultipart[T]andBindMultipartWithConfig[T]formultipart/form-databody bindingFormFile(r, field)returns a single uploaded file header;FormFiles(r)returns all uploaded filesBind[T]now auto-detects content type: JSON, form, and multipart are dispatched automatically; unknown types return 415BindJSON[T]andBindJSONWithConfig[T]for explicit JSON binding with content-type enforcementMaxMultipartMemoryfield onConfig(defaults to 32 MB) controls multipart memory thresholdformstruct tag supported in field name resolution for validation errors (checked beforejsontag)WithTLS(certFile, keyFile)option for HTTPS supportAddr()method returns the listener address after the server startsXML(w, statusCode, data)writes XML responses with<?xml?>headerIndentedJSON(w, statusCode, data)writes pretty-printed JSONPureJSON(w, statusCode, data)writes JSON without HTML escaping of<,>,&JSONP(w, r, statusCode, data)writes JSONP responses (reads?callback=query param)Reader(w, statusCode, contentType, contentLength, reader)streams fromio.Reader