APISonar


com.aliyuncs.http.ProtocolType.HTTP

> com > aliyuncs > http > ProtocolType > HTTP
com APIs aliyuncs APIs http APIs ProtocolType APIs HTTP APIs

Example 1
public void composeUrlTest() throws UnsupportedEncodingException {
        CommonRpcRequest commonRpcRequest = new CommonRpcRequest("test");
        commonRpcRequest.setSysProtocol(ProtocolType.HTTP);
        String url = commonRpcRequest.composeUrl("test/?", null);
        Assert.assertEquals("http://test/?Format=JSON", url);

        Map<String, String> map = new HashMap<String, String>(2);
        map.put("test", "test");
        url = commonRpcRequest.composeUrl("test", map);
        Assert.assertEquals("http://test/?test=test", url);
    }