报错Bad Request只是显式的错误,在ApiException里面有个resp返回的内容,在里面可以看到实际的错误,报错如下
couldn’t get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct
publicRequestBodyserialize(Objectobj,StringcontentType)throwsApiException{if(objinstanceofbyte[]){returnRequestBody.create(MediaType.parse(contentType),(byte[])((byte[])obj));}elseif(objinstanceofFile){returnRequestBody.create(MediaType.parse(contentType),(File)obj);}elseif(this.isJsonMime(contentType)){Stringcontent;if(obj!=null){content=this.json.serialize(obj);}else{content=null;}returnRequestBody.create(MediaType.parse(contentType),content);}else{thrownewApiException("Content type \""+contentType+"\" is not supported");}}