-
if i use this is likely because of this: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
As a workaround I appended the path to the url and passed to |
Beta Was this translation helpful? Give feedback.
-
❓ can only be passed in the URL for splicing. If they are escaped in the package main
import (
"context"
"log"
"github.com/carlmjohnson/requests"
)
func main() {
var err error
var rawBody string
if err = requests.URL("https://httpbun.org").
Path("/get?n=aaa&n=www").
// Pathf("/get?n=%s&n=%s", "aaa", "www").
// Pathf("/get%s", "?n=aaa&n=www").
// Param("n", "aaa", "www").
ToString(&rawBody).
Fetch(context.Background()); err != nil {
log.Println("[fetch]", err)
}
log.Println(rawBody)
} Output: [fetch] ErrValidator: response error for https://httpbun.org/get%3Fn=aaa&n=www: unexpected status: 404 In order to unify the writing, I did not use Hopefully it would be smarter and not escape the first ❓ after Thanks for your hard work! |
Beta Was this translation helpful? Give feedback.
As a workaround I appended the path to the url and passed to
BaseURL()
instead.