URL and Path conflict? #100
Answered
by
earthboundkid
safaci2000
asked this question in
Support
-
This might be intended behavior but I just wanted to make sure this is the case. req := requests.URL(url)
req.Header("Authorization", "Bearer secret1234")
req.Path(path).
Accept(ContentTypeJSON).
ToJSON(&responseObj).
BodyJSON(req.CaptureRequest).
Method(http.MethodDelete).
Fetch(ctx) if the url is something like http://localhost/api/v1/ the generated URL will http://localhost/users/list where it ignores the prefix of the URL and simply uses the path passed on. Is this intentional? It seems like a bug to me, but maybe this is expected? |
Beta Was this translation helpful? Give feedback.
Answered by
earthboundkid
Dec 20, 2023
Replies: 1 comment 2 replies
-
This is the expected behavior. To append a path, it needs to be relative (not begin with a slash). Try “users/list” or “./users/list” instead of “/users/list”. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
earthboundkid
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the expected behavior. To append a path, it needs to be relative (not begin with a slash). Try “users/list” or “./users/list” instead of “/users/list”.