From b85452f9c1798b043a4568d7daf3f6bd46088405 Mon Sep 17 00:00:00 2001 From: icbd Date: Mon, 7 Apr 2025 17:51:58 +0800 Subject: [PATCH] Fix SetRawPathParam doc --- client.go | 2 +- request.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client.go b/client.go index 61374df..ec6141f 100644 --- a/client.go +++ b/client.go @@ -1952,7 +1952,7 @@ func (c *Client) SetPathParams(params map[string]string) *Client { // client.SetRawPathParam("path", "groups/developers") // // Result: -// URL - /v1/users/{userId}/details +// URL - /v1/users/{path}/details // Composed URL - /v1/users/groups/developers/details // // It replaces the value of the key while composing the request URL. diff --git a/request.go b/request.go index c91ac0e..27821ae 100644 --- a/request.go +++ b/request.go @@ -766,7 +766,7 @@ func (r *Request) SetResponseBodyUnlimitedReads(b bool) *Request { // client.R().SetPathParam("path", "groups/developers") // // Result: -// URL - /v1/users/{userId}/details +// URL - /v1/users/{path}/details // Composed URL - /v1/users/groups%2Fdevelopers/details // // It replaces the value of the key while composing the request URL. @@ -805,16 +805,16 @@ func (r *Request) SetPathParams(params map[string]string) *Request { // SetRawPathParam method sets a single URL path key-value pair in the // Resty current request instance without path escape. // -// client.R().SetPathParam("userId", "sample@sample.com") +// client.R().SetRawPathParam("userId", "sample@sample.com") // // Result: // URL - /v1/users/{userId}/details // Composed URL - /v1/users/sample@sample.com/details // -// client.R().SetPathParam("path", "groups/developers") +// client.R().SetRawPathParam("path", "groups/developers") // // Result: -// URL - /v1/users/{userId}/details +// URL - /v1/users/{path}/details // Composed URL - /v1/users/groups/developers/details // // It replaces the value of the key while composing the request URL.