Return-Path: Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@www.apache.org Received: (qmail 27623 invoked from network); 30 Jul 2004 15:01:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 30 Jul 2004 15:01:42 -0000 Received: (qmail 92435 invoked by uid 500); 30 Jul 2004 15:01:23 -0000 Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@jakarta.apache.org Received: (qmail 92355 invoked by uid 500); 30 Jul 2004 15:01:22 -0000 Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Commons HttpClient Project" Reply-To: "Commons HttpClient Project" Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 92229 invoked by uid 99); 30 Jul 2004 15:01:20 -0000 X-ASF-Spam-Status: No, hits=1.8 required=10.0 tests=HTML_40_50,HTML_MESSAGE,HTML_TITLE_EMPTY X-Spam-Check-By: apache.org Received: from [69.0.254.30] (HELO ns7.bleublanc.net) (69.0.254.30) by apache.org (qpsmtpd/0.27.1) with SMTP; Fri, 30 Jul 2004 08:01:18 -0700 Received: (qmail 13579 invoked by uid 0); 30 Jul 2004 15:01:11 -0000 Received: from 203.168.30.213.in-addr.arpa (HELO ?192.168.200.183?) (213.30.168.203) by ns7.bleublanc.net with SMTP; 30 Jul 2004 15:01:11 -0000 Message-ID: <410A62AA.2090603@axecibles.com> Date: Fri, 30 Jul 2004 17:00:58 +0200 From: Mathias Cianci User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616) X-Accept-Language: fr, en MIME-Version: 1.0 To: Commons HttpClient Project Subject: Re: change cookie value References: <4109F42D.303@axecibles.com> <410A5381.4040401@axecibles.com> In-Reply-To: <410A5381.4040401@axecibles.com> Content-Type: multipart/alternative; boundary="------------070202020402040801050705" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --------------070202020402040801050705 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Ok! It works very fine ;-) Calendar cal = Calendar.getInstance(TimeZone.getDefault()); cal.set((Calendar.YEAR),cal.get(Calendar.YEAR)+1); java.util.Date d = cal.getTime(); HttpClient client = new HttpClient(); HttpState hs = client.getState(); hs.addCookie(new Cookie("search.msn.fr", "smc_classic", "df=0&af=0&rc=50&nw=0&sc=&rs=1", "/", d, false)); hs.addCookie(new Cookie("search.msn.fr", "smc_g", "v=1&pvs=classic&ssp=1&df=1", "/", d, false)); client.setState(hs); Mathias Cianci a �crit : > Thank you Mike. > > But after a long reflexion, I've found that I've not taken the good > part of the problem. > > In fact, what I want to do is to send a Cookie in the headers of my > first requested page, no matter the cooklies sets by the server. > > How to do that ? > > Mathias > > PS: my english is not really good, don't hesitate to tell me if I'm > not really comprehensive. > > Michael Becke a �crit : > >> Hi Mathias, >> >> The best way is to just create a new instance of Cookie, copying the >> values you want to keep, and add it to the HttpState. >> >> Mike >> >> On Jul 30, 2004, at 3:09 AM, Mathias Cianci wrote: >> >>> Hello everybody, >>> >>> Is it possible with httpclient to change the value of a specific >>> variable sent in a cookie by a server. >>> >>> For example, when the server send the cookie var1=5&*var2=7*&var3=4, >>> I want to save the cookie var1=5&*var2=174*&var3=4 >>> >>> Thank you for advance, >>> >>> Mathias >>> An happy httpclient-user ;-) >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: >> commons-httpclient-dev-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: >> commons-httpclient-dev-help@jakarta.apache.org >> >> >> > --------------070202020402040801050705--