aspose file tools*
The moose likes Java Micro Edition and the fly likes How to truncate http request size to minimum? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "How to truncate http request size to minimum?" Watch "How to truncate http request size to minimum?" New topic
Author

How to truncate http request size to minimum?

Zandis Murāns
Ranch Hand

Joined: Aug 18, 2009
Posts: 174

To save GPRS traffic, I wan't to delete some headers from my midlet's request. For example, if regular response headers looks like this:


then it would be great to truncate such headers to something like this:



If I try to do



then it takes no changes into resulting Http Request Headers - User agent stays as it was - Nokia5310XpressMusic/2.0 (05.81) Profile/MIDP-2.1 Configuration/CLDC-1.1 UNTRUSTED/1.0

In API docs of HttpConnection interface, there is written:
setRequestProperty
public void setRequestProperty(String key,
String value)
throws IOException
Sets the general request property. If a property with the key already exists, overwrite its value with the new value.


Looks like Nokia add that user-agent header right before connection is opening. So how to avoid this? How to truncate these headers to minimum?
Zandis Murāns
Ranch Hand

Joined: Aug 18, 2009
Posts: 174

ok, never mind, ill do SocketConnection instead of HttpConnection
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to truncate http request size to minimum?