Questions tagged [uribuilder]
82 questions
244
votes
8 answers
Use URI builder in Android or create URL with variables
I'm developing an Android app. I need to build a URI for my app to make an API request. Unless there's another way to put a variable in a URI, this is the easiest way I've found. I found that you need to use Uri.Builder, but I'm not quite sure how…

hichris123
- 10,145
- 15
- 56
- 70
10
votes
2 answers
UriBuilder fail to encode UriBuilder registered sign
I am working on an asp.net mvc web application. now i have a value for operating system which equal to :-
and i am using the following code to build a url containing the above value as follow:-
var query =…

John John
- 1
- 72
- 238
- 501
9
votes
1 answer
URIBuilder setParameter adds + instead of %20 for space
I'm trying to build a URL using URIBuilder and for some reason I get + instead of %20 for space.
this is my code:
URI uri=null;
try {
uri = ub.setScheme("http")
…

ufk
- 30,912
- 70
- 235
- 386
9
votes
2 answers
UriBuilder.Query
I found a strange behavior UriBuilder in .NET
Senario 1:
Dim uri As New UriBuilder("http://www.test/login.aspx")
uri.Query = "?test=Test"
Dim url As String = uri.ToString()
After this code is run the url string contains…

Peter
- 37,042
- 39
- 142
- 198
8
votes
2 answers
How to build a URI using URIbuilder without encoding hash
I have a URI like this:
java.net.URI location = UriBuilder.fromPath("../#/Login").queryParam("token", token).build();
and I am sending it as response: return Response.seeOther(location).build()
However, in the above URI, # is getting encoded to…

kittu
- 6,662
- 21
- 91
- 185
8
votes
6 answers
Replace query parameters in Uri.Builder in Android?
I'm passing around a Uri.Builder object as a mechanism for subclasses to fill in whatever parameters necessary into a Uri before it is executed in Android.
Problem is, one of the parameters that the base class adds using…

Dhiraj Gupta
- 9,704
- 8
- 49
- 54
8
votes
2 answers
Why does .NET have a UriBuilder as opposed to a UrlBuilder?
OK, so having digested such excellent answers as this one difference between URLs and URIs, I think I now understand the distinction between the two.
What I now don't understand is why the .NET Framework has a UriBuilder class, which - as far as I…

Dylan Beattie
- 53,688
- 35
- 128
- 197
6
votes
1 answer
Android Uri.Builder using "/" instead of "//" after scheme
I dug through the source code, but I just can't find a reason for this behavior.
According to Use URI builder in Android or create URL with variables, this should work absolutely fine.
Say I want to connect to…

OneCricketeer
- 179,855
- 19
- 132
- 245
6
votes
2 answers
URIBuilder and list query params
I'm using apache URIBuilder to build a query string for a GET method of a Rest service.
@RequestMapping(value="/remote")
public Return getTest(Ordine ordine) throws Exception{
...
}
This is the input object:
public class Ordine{ …

Tobia
- 9,165
- 28
- 114
- 219
5
votes
3 answers
How to construct a URI with parameters using URIBuilder?
How to construct a URI like www.google.com/p1/p2?what&k1=v1&k2=v2 using URIBuilder ?
When I use Java's URIBuilder.setParameter(), I must pass in an name and a value.
How can I construct the above uri without using URIBuilder.setCustomQuery() ?

zeromem
- 381
- 1
- 3
- 12
5
votes
1 answer
What's the difference between new Uri(..) and new UriBuilder(..).Uri for the same host?
In a web application, I have an audienceURI used for the authentication. When I set it from code like the following:
var audience1 = new UriBuilder("dev.website.com")
{
Port = 443,
Scheme =…

Homam
- 23,263
- 32
- 111
- 187
4
votes
1 answer
How should you build an OData URI?
I'm looking to build URIs such as https://example.com/data/customers?$top=100.
Is there a UriBuilder for creating OData URIs (i.e. which can handle characters such as $ appropriately)?
Full info
I have code like this (simplified example):
public Uri…

JohnLBevan
- 22,735
- 13
- 96
- 178
4
votes
0 answers
JAX-RS 2.0 UriBuilder exception
I've been dealing with this issue for over two days now, I've looked at all the tickets that I could find that are even remotely to this issue. I've tried using different versions of JAX-RS but it always comes down to this issue.
I recently saw the…

Ahmad Alroudhan
- 51
- 1
- 1
- 3
4
votes
1 answer
Building URL using URI builder
Encoded URL -
https://spreadsheets.google.com/tq?tqx=out:JSON&tq=select%20*%20where%20((A%20%3D%20201))&key=1424bS7kU8nJbHdu4QdoAFdIdWDSnmEnj2NqfMb6rPTU
Decoded URL -
https://spreadsheets.google.com/tq?tqx=out:JSON&tq=select * where ((A=…

Parv bali
- 147
- 1
- 11
4
votes
2 answers
How do I add array parameters to an url using Uri.Builder?
I need to generate an url with an array parameter, or looking like so:
?array_name[]=value1&array_name[]=value2
How to achieve this with Uri.Builder? The following code:
Uri.Builder builder = new…

Konrad Morawski
- 8,307
- 7
- 53
- 91