Perform Get request with matrix parameters?

2019-08-20 08:25发布

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.

2条回答
祖国的老花朵
2楼-- · 2019-08-20 08:44
  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();
查看更多
Fickle 薄情
3楼-- · 2019-08-20 09:04

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

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

查看更多
登录 后发表回答