Alterar headers da requisição com urlConnection

0 respostas
The_Toad

Salve galera,

Como posso alterar os headers de uma conexão criada com o urlConnection? Por exemplo, os headers da minha conexão são (Key : Value):

null : [HTTP/1.1 200 OK]
Date : [Mon, 09 Feb 2009 16:40:28 GMT]
Transfer-Encoding : [chunked]
Content-Type : [text/xml]
Server : [Toolbar document spell checker]
Cache-Control : [private, x-gzip-ok=""]

Eu preciso alterar pra algo como:

"POST " + path + " HTTP/1.1\r\n"  
"Host: " + google + "\r\n" + 
"Content-Length: " + data.length() + "\r\n" + 
"Content-type: application/x-www-form-urlencoded\r\n" +
"Connection: Close\r\n\r\n" +

Obrigado!
[]'s.

Criado 9 de fevereiro de 2009
Respostas 0
Participantes 1