forked from loafle/openapi-generator-original
[Android][Volley] fix support for post null body
This commit is contained in:
parent
cfa40b1484
commit
0816f315d3
@ -34,11 +34,17 @@ public class PostRequest extends Request<String> {
|
||||
|
||||
@Override
|
||||
public String getBodyContentType() {
|
||||
if(entity == null ) {
|
||||
return null;
|
||||
}
|
||||
return entity.getContentType().getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getBody() throws AuthFailureError {
|
||||
if(entity == null) {
|
||||
return null;
|
||||
}
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
try {
|
||||
entity.writeTo(bos);
|
||||
|
Loading…
x
Reference in New Issue
Block a user