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
|
@Override
|
||||||
public String getBodyContentType() {
|
public String getBodyContentType() {
|
||||||
|
if(entity == null ) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return entity.getContentType().getValue();
|
return entity.getContentType().getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getBody() throws AuthFailureError {
|
public byte[] getBody() throws AuthFailureError {
|
||||||
|
if(entity == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
try {
|
try {
|
||||||
entity.writeTo(bos);
|
entity.writeTo(bos);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user