Hi Paul,
POST /abc/xyz HTTP/1.1
Content-Type: application/xml
Host: localhost:9998
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Content-Length: 114
<VSEDHCPConfigResource><a>value1</a><b>valueb</b><c>valuec</c><d>valued</d><e>valuee</e></VSEDHCPConfigResource>
Above is the request that has leading spaces in the xml body without XMLDecl and works fine.
________________________________
From: Paul Sandoz <Paul.Sandoz@Sun.COM>
To: dev@jersey.dev.java.net
Sent: Monday, 3 August, 2009 4:17:39 PM
Subject: Re: [Jersey] Leading Spaces in JAXB
On Aug 3, 2009, at 12:39 PM, Minjal Shah wrote:
> Hi Paul,
>
> The request that has leading spaces, was sent out using netcat.
> As you pointed out, the grammer does not allow it, BAD REQUEST is justified. Thanks !
>
> But, now with the request like the below where the XMLDecl is omitted, does not mind getting leading spaces.
>
> POST /abc/xyz HTTP/1.1
> Content-Type: application/xml
> Host: localhost:9998
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> Content-Length: 112
>
> <VSEDHCPConfigResource><a>value1</a><b>valueb</b><c>valuec</c><d>valued</d><e>valuee</e></VSEDHCPConfigResource>
>
> Please explain.
>
I do not see any leading spaces in the above. Note the Content-Length value of 112. That is the number of characters that make up the XML document.
I think you may be confusing the CRLF that is required for HTTP to demarcate the HTTP headers and the start of the request entity. Look at the grammar specified for HTTP here:
http://greenbytes.de/tech/webdav/rfc2616.html#http.message
Paul.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@jersey.dev.java.net
For additional commands, e-mail: dev-help@jersey.dev.java.net
Love Cricket? Check out live scores, photos, video highlights and more. Click here
http://cricket.yahoo.com