[
https://issues.apache.org/jira/browse/SQOOP-1795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14223170#comment-14223170
]
Jarek Jarcec Cecho commented on SQOOP-1795:
-------------------------------------------
We already do have that wrapper [~vybs], it's class
{{[ReqeustContext|https://github.com/apache/sqoop/blob/sqoop2/server/src/main/java/org/apache/sqoop/server/RequestContext.java]}}.
Currently we're exposing the internal {{[HttpServletRequest
|https://github.com/apache/sqoop/blob/sqoop2/server/src/main/java/org/apache/sqoop/server/RequestContext.java#L40]}}
object to the outside world and I'm all up for stop doing that and offer
methods that will expose all that we need. We can even go as far as guarding
against trying to get the request body twice.
My point is that I would like us to be focused on the real problem - that is
that we were reading and parsing the body twice when we shouldn't and rectify
that rather then providing solution where we can easily read the request body
several times.
> Sqoop2: Retrieve Http post data in plausible manner
> ---------------------------------------------------
>
> Key: SQOOP-1795
> URL: https://issues.apache.org/jira/browse/SQOOP-1795
> Project: Sqoop
> Issue Type: Sub-task
> Reporter: Qian Xu
> Assignee: Qian Xu
> Fix For: 1.99.5
>
>
> The situation of dealing with the post data is very tricky IMHO.
> 1. {{getRequest().getReader()}} must be called at the first place. As reading
> position cannot be reset, you might get unexpected result without notice.
> SQOOP-1784 is a case of the situation.
> 2. Sqoop client sends post data as a JSON object rather than query string
> format. Usually it'd suggest to wrap the JSON object as value, and key can be
> named as "jsonObject". The server will call
> {{ctx.getParameterValue("jsonObject")}} to get the value.
> I'd suggest to have a {{getRawPostData()}}, so that callers can put finger
> away from {{getReader()}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)