Perform Get request with matrix parameters?

让人想犯罪 __ 提交于 2019-12-12 02:59:51

问题


I want to perform a GET request using matrix parameters. http://localhost:8080/car/bmw;color=red

There is allready this question answered Creating a GET request with matrix parameters ,but there is not real step by step explanation there.


回答1:


Also you can do it easier still using rest-assured.

given().urlEncodingEnabled(false).when(). get("http://localhost:8080/car/bmw;color=red")




回答2:


  ResteasyClient client = new ResteasyClientBuilder().build();
            ResteasyWebTarget target = client.target("http://localhost:8080/car/bmw;color=red");
            Response response = target.request().get();
            String value = response.readEntity(String.class);
            System.out.println(value);
            response.close();


来源:https://stackoverflow.com/questions/35387879/perform-get-request-with-matrix-parameters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!