Skip to content

Is FormData encoded by default? #890

Closed Answered by jeevatkm
michealroberts asked this question in Q&A
Discussion options

You must be logged in to vote

@michealroberts Thanks for reaching out.

Resty does the Form data encoding and sets appropriate content type when request form data methods are used. You could use the search string SetForm on Resty godoc to find those methods.

Code reference:

resty/middleware.go

Lines 501 to 502 in a6a489b

r.bodyBuf.WriteString(r.FormData.Encode())
r.Header.Set(hdrContentTypeKey, formContentType)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jeevatkm
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants