Question: I am working on a website where i have two types of offer, Hot offer and Best Offer. I have 5 hot offer and 5 best offer. First 1 hot offer will come, then 1 best offer will come and so on. Now after 1 refresh the the 1st hot offer should replace 2nd hot offer, 2nd sholud replace 3rd hot offer, 3rd should replace 4th one, 4th should replace 5th hot offer and 5th hot offer should replace 1st hot offer. This should be same for best offer also.

It is like

**1st hot offer**

**1st Best Offer**

**2nd Hot Offer**

**2nd Best Offer**

........

........

........

........

**5th Hot Offer**

**5th Best offer**

After Refresh It should Be....

**5th Hot Offer**

**5th Best Offer**

**1st Hot Offer**

**1st Best Offer**

.......

........

........

.......

**4th Hot Offer**

**4th Best Offer**

Please help me. I am getting too much trouble in doing it.

Answer: 
In theory, the URI in an HTTP request can be of any length, but the practical limit is on the order of 2k. Please [read here](https://stackoverflow.com/q/417142/725163) for more info on that.

I am assuming the length is coming from the query string parameters (those `name=value` pairs that come after the `?`). You should be putting these in the `POST` data, leaving the `path` part of the URI only. Of course, the server will have to be looking for those parameters in the `POST` data as well.
It's not clear exactly what you're trying to achieve, but this definitely looks wrong:

```
URL url = new URL(syn_data1.toString());
URLEncoder.encode(syn_data1.toString(),"UTF-16BE");

```

If `syn_data1` is already a string, you don't need to call `toString` on it.. and calling `URLEncoder.encode` doesn't have any side-effects, so the second statement is pointless. Perhaps you want:

```
URL url = new URL(URLEncoder.encode(syn_data1, "UTF-16BE"));

```

That's just on the encoding side though - you still shouldn't be trying to use enormous URLs. If you have a lot of data, that should be in the body of the request rather than the URL.