• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to truncate http request size to minimum?

 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 174
Java Java ME Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, never mind, ill do SocketConnection instead of HttpConnection
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic