Questions tagged [uribuilder]

82 questions
4
votes
2 answers

EXTBASE: How to get current page uri in extbase controller?

How to get uri of current page in extbase extension controller? In case I need to send current uri via email or save it to database for later use or statistics.
gSorry
  • 1,254
  • 2
  • 21
  • 29
3
votes
1 answer

How to build URI with UriBuilder without specifying scheme, host separately?

Ref: org.springframework.web.util.UriBuilder I am using UriBuilder to build a URI for an endpoint final String response = myWebClient.get() .uri(uriBuilder -> uriBuilder.scheme("https").path("example.com/mypage").path("/{id}.xml").build(id)) …
Saif
  • 2,530
  • 3
  • 27
  • 45
3
votes
0 answers

Send Map of query parameters to Spring uriBuilder

I can't find how to pass a Map of query parameters to uriBuilder even with a method found on Google which explains that we need to pass a LinkedMultiValueMap. This is my method : public Mono get(String uri, LinkedMultiValueMap params) { …
Pierre Jones
  • 620
  • 1
  • 11
  • 24
3
votes
2 answers

Encoding issue with curly brackets and space in UriBuilder

I am using the com.sun.jersey.api.uri.UriBuilderImpl implementation of UriBuilder to encode a URL (version 1.19). The issue arises when the query parameter of my URL includes both curly brackets and a space. Example: UriBuilder uriBuilder =…
pavlos163
  • 2,730
  • 4
  • 38
  • 82
3
votes
0 answers

Java : Building URI with fragment before query params

I am looking to build a URI of the type : https://example.com/index.html#db/report/csv?token=4cec23a8a07b63c1ed74&time=1473951700000&name=GA but what I am trying is producing incorrect results…
greperror
  • 5,156
  • 3
  • 20
  • 29
3
votes
0 answers

Appending query params to relative Uri

I have a relative uri as a string, only sometimes with query parameters. For instance /?abc. My task is to append l=a to a query. I tried to use methods of Uri and UriBuilder, but it seems both of them do not support relative uris. Any ideas?
Denis
  • 3,653
  • 4
  • 30
  • 43
3
votes
1 answer

Preserve arguments in uri builder

Let's say that I have a page with URI: http://mydomain.loc/index.php?id=123&by=name&dir=desc and need to add/update/remove some other param (let's name it offset) to it, so after all it will be: …
biesior
  • 55,576
  • 10
  • 125
  • 182
3
votes
3 answers

How to use a UriBuilder and HttpUtility.ParseQueryString to store a URL and parse it

What I'm trying to do is use an UriBuilder and HttpUtility.ParseQueryString to get the last page the user visited and then parse the URL to get just the productID. (The product ID is different on each page if that matters) example URL:…
JavaTheScript
  • 137
  • 3
  • 16
2
votes
1 answer

Can I add a list or array of query strings to uribuilder?

I'm using UriBuilder to create a url for an API endpoint. I need to add some query strings for it, and I can do that nicely with the following example: private async Task CallAPI(string url, string queryString) { string s =…
penstiaGarse
  • 161
  • 7
2
votes
2 answers

How add a trailing slash after the port in apache URIBuilder?

I am trying to build a URI having a trailing slash but can't happen to find the way to do it with URIBuilder. Is that even possible? Expected result would be: http://test.com:24/?param1=value1¶m2=value2 @Test public void ttt(){ final…
Xbreizh
  • 333
  • 4
  • 19
2
votes
0 answers

Is it possible to use apache's URIBuilder to set a parameter with percentage sign?

I want to build this complete URL: locahost/some/path?param1=%06 using org.apache.http.client.utils.URIBuilder method setParameter(final String param, final String value). At its javadoc, there's line: The parameter name and value are expected to…
rado
  • 5,720
  • 5
  • 29
  • 51
2
votes
1 answer

How to use UriBuilder.queryParam without encoding parameters?

I'm writing a REST API endpoint with pagination and I want it to include the links to the first, previous, next and last pages. I also want these links to include whatever parameters that were sent in the original request (BTW is that a bad…
uzilan
  • 2,554
  • 2
  • 31
  • 46
2
votes
2 answers

Azure Rate Card api query using URIBuilder

I am having difficulty building the URL correctly using URIBuilder in a grrovy script. This is what it the documentation says it should look like -…
Mondo
  • 163
  • 13
2
votes
1 answer

How to make hash content before query parameters by uribuilder when creating url

I use uribuilder object from apache.http.client to create url example:www.xxx.com/#/path/?query=123 my code as follow URIBuilder uriBuilder = new…
2
votes
1 answer

Apache Http UrlBuilder stripping API version from URL

All, I have my base url defined in a config like so foobar.baseurl = https://api.foobar.com/v3/reporting/ This is passed as a constructor argument for my Spring bean
tomaytotomato
  • 3,788
  • 16
  • 64
  • 119