Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8377311BD1 for ; Fri, 27 Jun 2014 02:04:41 +0000 (UTC) Received: (qmail 14137 invoked by uid 500); 27 Jun 2014 02:04:41 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 14084 invoked by uid 500); 27 Jun 2014 02:04:41 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 14064 invoked by uid 99); 27 Jun 2014 02:04:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jun 2014 02:04:40 +0000 X-ASF-Spam-Status: No, hits=1.6 required=5.0 tests=FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.220.53 as permitted sender) Received: from [209.85.220.53] (HELO mail-pa0-f53.google.com) (209.85.220.53) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jun 2014 02:04:37 +0000 Received: by mail-pa0-f53.google.com with SMTP id ey11so3939385pad.40 for ; Thu, 26 Jun 2014 19:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:content-transfer-encoding:content-disposition; bh=PWuz8HwP1BPO5gAKnmK1CRKme20WEXsBs/Mm5NgAS7E=; b=wp0YzJMM0fM+VlvfjeP9+L12SpJIyJOZaUqPT9TGCKDb89oZg3AhRbl00/pTW31pqg 8W9mqxDAJi1xX6i1cmA8YAukfuJE4B+p92wxra1b8j9XwElUZHPLAPXsmQhgTcE8PDpt IpLWXsFXjuoOQKXLPB4lTHZXmzIAXeVcW1kSO54w/IONGJt2UCYa2/wf/QERPZqJ1F0E UmRU4QiEAcqEWBlqkx5pb3F+eMS7ZHQ6tIziPwJeYf4AlRfVeknkLqVzoLJH2OSUSCa3 3tgf5KZG1UrXBMCvAwG1t1s7bkansLo0udV77W7AcrIQXfaco+UyCNw7T5Tx2X2hvwcL P1RA== X-Received: by 10.68.227.164 with SMTP id sb4mr7258500pbc.63.1403834651943; Thu, 26 Jun 2014 19:04:11 -0700 (PDT) Received: from localhost ([125.34.2.149]) by mx.google.com with ESMTPSA id i10sm43135987pat.36.2014.06.26.19.04.07 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Jun 2014 19:04:08 -0700 (PDT) Date: Fri, 27 Jun 2014 10:04:01 +0800 From: Willem Jiang To: users@camel.apache.org Message-ID: In-Reply-To: <1403809323640-5752892.post@n5.nabble.com> References: <1390505313476-5746414.post@n5.nabble.com> <37C14F03FA796B4283CCEAE854CA7FD111E26DA3@CTSINCHNSXMBR.cts.com> <1390579767345-5746452.post@n5.nabble.com> <1403788537452-5752856.post@n5.nabble.com> <1403809323640-5752892.post@n5.nabble.com> Subject: Re: Http4 Set Header Content-Type not passing through to the HTTP Request X-Mailer: Airmail (237) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org The content-type is part of request entity, =C2=A0as there is no request = entity body in the GET Http method, camel-http4 doesn=E2=80=99t put the C= ontent-Type header into http header. Here a discussion=5B1=5D which is about it in stack overflow. =5B1=5Dhttp://stackoverflow.com/questions/5661596/do-i-need-a-content-typ= e-for-http-get-requests -- =20 Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang =20 Weibo: =E5=A7=9C=E5=AE=81willem On June 27, 2014 at 3:10:21 AM, sandeepreddip (sandeepreddip=40gmail.com)= wrote: > Thanks for the reply,bit I'm a bit confused, I indeed set the headers o= n * > Message message =3D exchange.getIn(); * > *Attached is complete trace of the route. Camel=5Fhttp4=5FGET=5Ftrace.t= xt > =20 > * I appreciate if you could shed some more light on it. > =20 > I tried by directly setting the header on the route. But still faced th= e > same issue. > =20 > /from(=22timer:foo=3Fperiod=3D1000=22).setHeader(Exchange.HTTP=5FMETHOD= , > constant(org.apache.camel.component.http4.HttpMethods.GET)) > .setHeader(Exchange.CONTENT=5FTYPE, > constant(RestConstants.APPLICATION=5FOTHER=5FXML)) > .setHeader(Exchange.HTTP=5FCHARACTER=5FENCODING, constant(=22UT=46-8=22= )) > .setHeader(HttpHeaders.ACCEPT, > constant(RestConstants.APPLICATION=5FOTHER=5FXML)).to(=22http4://localh= ost:8080/cts-rest/cts/users=22).bean( =20 > CamelBeanBinding.class,=22invokeMethod7=22);/ > =20 > *Below is the trace of the Message History* > =20 > =20 > =20 > *Message History* > -----------------------------------------------------------------------= ---------------------------------------------------------------- =20 > RouteId ProcessorId Processor > Elapsed (ms) > =5Broute1 =5D =5Broute1 =5D =5Btimer://foo=3Fperiod=3D1000 > =5D =5B 79=5D > =5Broute1 =5D =5BsetHeader1 =5D =5BsetHeader=5BCamelHttpMethod=5D > =5D =5B 0=5D > =5Broute1 =5D =5BsetHeader2 =5D =5BsetHeader=5BContent-Type=5D > =5D =5B 0=5D > =5Broute1 =5D =5BsetHeader3 =5D > =5BsetHeader=5BCamelHttpCharacterEncoding=5D > =5D =5B 0=5D > =5Broute1 =5D =5BsetHeader4 =5D =5BsetHeader=5BAccept=5D > =5D =5B 0=5D > =5Broute1 =5D =5Bto1 =5D > =5Bhttp4://localhost:8080/cts-rest/cts/users > =5D =5B 79=5D > =20 > *Exchange* > -----------------------------------------------------------------------= ---------------------------------------------------------------- =20 > Exchange=5B > Id ID-sporeddy-60089-1403808232902-0-2 > ExchangePattern InOnly > Headers =7BAccept=3Dapplication/*+xml, > breadcrumbId=3DID-sporeddy-60089-1403808232902-0-1, > CamelHttpCharacterEncoding=3DUT=46-8, CamelHttpMethod=3DGET, > CamelRedelivered=3Dfalse, CamelRedeliveryCounter=3D0, > Content-Type=3Dapplication/*+xml, firedTime=3DThu Jun 26 14:43:54 EDT 2= 014=7D > BodyType null > Body =5BBody is null=5D > =5D > =20 > =20 > =20 > -- > View this message in context: http://camel.465427.n5.nabble.com/Http4-S= et-Header-Content-Type-not-passing-through-to-the-HTTP-Request-tp5746414p= 5752892.html =20 > Sent from the Camel - Users mailing list archive at Nabble.com. > =20