You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
client.URL or client.BaseURL with empty host but port will send request to localhost
for example:
// Create a new client
cli := gentleman.New()
// Define the Base URL
// when host is empty, but port, there will cause an undefined behavior
// cli.BaseURL(fmt.Sprintf("http://%s:%s", host, port))
cli.BaseURL("http://:8889") // or cli.URL("http://:8889")
// fmt.Println(cli.Context.Request.URL.String())
// Create a new request based on the current client
req := cli.Request()
// Method to be used
req.Method("POST")
// Define the JSON payload via body plugin
data := map[string]string{"foo": "bar"}
req.Use(body.JSON(data))
// Perform the request, then it will send request to localhost
res, err := req.Send()
The text was updated successfully, but these errors were encountered:
client.URL or client.BaseURL with empty host but port will send request to localhost
for example:
The text was updated successfully, but these errors were encountered: