Skip to content

Support application/x-www-form-urlencoded. #2

@ghosind

Description

@ghosind

Add the support of form data (without binary data), and set the value of the Content-Type field in the request header to application/x-www-form-urlencoded.

  • For url.Values object, just call the Encoded method to encode it.
  • For struct and map, check the type of all fields, convert the values to the strings, and encode them like url.Values object.

Example code

data := SomeType{
  F1: "Value 1",
  F2: 2,
  // and other data...
}

Request(dest, RequestConfig{
  Body: data,
  ContentType: "form"
})
// f1=Value 1&f2=2 // ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions