我正在
405方法不允许
当我尝试使用以下代码修补应用程序时。如何解决?
RequestBody body = new MultipartBuilder()
.type(MultipartBuilder.FORM)
.addFormDataPart("file", fileName, RequestBody.create(MediaType.parse("application/zip"), uploadZipFile))
.addFormDataPart("artifactName", "gpswalker")
.addFormDataPart("targetId", new Integer(SERV_ID).toString())
.build();
Request request = new Request
.Builder()
.url(url)
.patch(body)
.addHeader("authorization", bearer_token)
.addHeader("x-anypnt-org-id", ORG_ID)
.addHeader("x-anypnt-env-id", ENV_ID)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
答案 0 :(得分:0)
代码没有错,问题是URL。它是固定的。