使用矩阵参数创建GET请求

编程入门 行业动态 更新时间:2024-10-27 18:26:08
本文介绍了使用矩阵参数创建GET请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我将使用的网络服务需要矩阵参数:

The webservice I'll be using expects matrix parameters:

tester/v1/customers;lastname=Jackson;firstname=Tim;bookingreference=7Y9UIY

而不是通常的

tester/v1/customers?lastname=Jackson&firstname=Tim&bookingreference=7Y9UIY

无论如何,我可以使用Spring UriComponentsBuilder或其他方式创建请求吗?

Is there anyway I can create a request using the Spring UriComponentsBuilder or an alternative?

我知道我可以手动创建它,但希望有更精简的可用。

I'm aware that I could just create it manually but hoped there was something more streamlined available.

推荐答案

UriBuilder 和 WebTarget 允许添加矩阵参数。

UriBuilder and WebTarget of JAX-RS allow to add matrix params.

UriBuilder builder = ... builder.matrixParam("lastname", "Jackson").matrixParam("firstname", "Tim")...

更多推荐

使用矩阵参数创建GET请求

本文发布于:2023-11-26 05:38:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1632850.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:矩阵   参数

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!