Set URL Path Parameter

Request Level

Use SetPathParam or SetPathParams to set url path parameter at request-level:

client := req.C().DevMode()

    SetPathParam("owner", "imroc"). // Set a path param, which will replace the vairable in url path
    SetPathParams(map[string]string{ // Set multiple path params at once
        "repo": "req",
        "path": "",
    }).Get("{owner}/{repo}/contents/{path}") // path parameter will replace path variable in the url

2022/01/23 14:43:59.114592 DEBUG [req] GET

Client Level

Similarly, you can use SetCommonPathParam or SetCommonPathParams to set the common url path parameter for every request on client:

client := req.C().DevMode().
	SetCommonPathParam(k1, v1).

resp1, err := client.Get(url1)

resp2, err := client.Get(url2)