You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "Bo Li (JIRA)" <ji...@apache.org> on 2018/05/16 08:56:00 UTC

[jira] [Resolved] (SCB-75) Why it must be json format when receiving bytes through @RequestBody byte[] buffer

     [ https://issues.apache.org/jira/browse/SCB-75?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bo Li resolved SCB-75.
----------------------
    Resolution: Resolved

> Why it must be json format when receiving bytes through @RequestBody byte[] buffer
> ----------------------------------------------------------------------------------
>
>                 Key: SCB-75
>                 URL: https://issues.apache.org/jira/browse/SCB-75
>             Project: Apache ServiceComb
>          Issue Type: Bug
>            Reporter: Bo Li
>            Priority: Major
>
> Parameter invalid error occurs when received data is not json format when using @requestbody byte[] buffer
> {code}
> @RequestMapping(value = "/update", method = RequestMethod.PUT)
>     public ResponseEntity<String> update(@PathVariable("accountId") Long accountId,
>           @RequestHeader("Date") String date,
>          @RequestBody byte[] buffer, HttpServletRequest request)
>     {
>            byte[] data = buffer;   //buffer data have to be json format here
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)