Skip to content

Request.generateUrl 和 Request.sendRequest所使用的URL不同 #22

Description

@zuoky

如果我们直接使用generateUrl的返回值, 当参数中有一些[&]时,比如[C:itemType:A]&[C:city:SZ],就会出现鉴权失败的问题。

Request.generateUrl
String url = "https://" + requestHost + requestPath; if (requestMethod.equals("GET")) { url += Sign.buildParamStr1(params,requestMethod); }

Request.send
try { paramStr += key + '=' + URLEncoder.encode(requestParams.get(key).toString(),"utf-8"); } catch (UnsupportedEncodingException e) { result = "{\"code\":-2300,\"location\":\"com.qcloud.Common.Request:129\",\"message\":\"api sdk throw exception! " + e.toString().replace("\"", "\\\"") + "\"}"; }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions