Skip to content

restful post 乱码 #3

Description

@dextergithub

`public String getData(HttpServletRequest req) {
StringBuffer info = new java.lang.StringBuffer();
InputStream in = null;
try {
in = req.getInputStream();
} catch (IOException e) {
// TODO Auto-generated catch block
AlbianServiceRouter.getLogger().error(
IAlbianLoggerService.AlbianRunningLoggerName, e, "getData");
}
BufferedInputStream buf = new BufferedInputStream(in);
byte[] buffer = new byte[1024];
int iRead;
try {
while ((iRead = buf.read(buffer)) != -1) {
info.append(new String(buffer, 0, iRead, "UTF-8"));
}
} catch (UnsupportedEncodingException e) {
AlbianServiceRouter.getLogger().error(
IAlbianLoggerService.AlbianRunningLoggerName, e, "getData");
} catch (IOException e) {
AlbianServiceRouter.getLogger().error(
IAlbianLoggerService.AlbianRunningLoggerName, e, "getData");
}

    return info.toString();

}`

Albianj2/Albianj.Restful.Impl/src/org/albianj/restful/impl/util/AlbianRestfulUtils.java

post 这个地方会导致乱码。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions