当前位置: 首页>>代码示例>>Java>>正文


Java PATCH类代码示例

本文整理汇总了Java中retrofit2.http.PATCH的典型用法代码示例。如果您正苦于以下问题:Java PATCH类的具体用法?Java PATCH怎么用?Java PATCH使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PATCH类属于retrofit2.http包,在下文中一共展示了PATCH类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: twoMethodsFail

import retrofit2.http.PATCH; //导入依赖的package包/类
@Test public void twoMethodsFail() {
  class Example {
    @PATCH("/foo") //
    @POST("/foo") //
    Call<ResponseBody> method() {
      return null;
    }
  }

  try {
    buildRequest(Example.class);
    fail();
  } catch (IllegalArgumentException e) {
      assertThat(e.getMessage())
          .isIn("Only one HTTP method is allowed. Found: PATCH and POST.\n    for method Example.method",
                "Only one HTTP method is allowed. Found: POST and PATCH.\n    for method Example.method");
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:RequestBuilderTest.java

示例2: parseMethodAnnotation

import retrofit2.http.PATCH; //导入依赖的package包/类
private void parseMethodAnnotation(Annotation annotation) {
  if (annotation instanceof DELETE) {
    parseHttpMethodAndPath("DELETE", ((DELETE) annotation).value(), false);
  } else if (annotation instanceof GET) {
    parseHttpMethodAndPath("GET", ((GET) annotation).value(), false);
  } else if (annotation instanceof HEAD) {
    parseHttpMethodAndPath("HEAD", ((HEAD) annotation).value(), false);
    if (!Void.class.equals(responseType)) {
      throw methodError("HEAD method must use Void as response type.");
    }
  } else if (annotation instanceof PATCH) {
    parseHttpMethodAndPath("PATCH", ((PATCH) annotation).value(), true);
  } else if (annotation instanceof POST) {
    parseHttpMethodAndPath("POST", ((POST) annotation).value(), true);
  } else if (annotation instanceof PUT) {
    parseHttpMethodAndPath("PUT", ((PUT) annotation).value(), true);
  } else if (annotation instanceof OPTIONS) {
    parseHttpMethodAndPath("OPTIONS", ((OPTIONS) annotation).value(), false);
  } else if (annotation instanceof HTTP) {
    HTTP http = (HTTP) annotation;
    parseHttpMethodAndPath(http.method(), http.path(), http.hasBody());
  } else if (annotation instanceof retrofit2.http.Headers) {
    String[] headersToParse = ((retrofit2.http.Headers) annotation).value();
    if (headersToParse.length == 0) {
      throw methodError("@Headers annotation is empty.");
    }
    headers = parseHeaders(headersToParse);
  } else if (annotation instanceof Multipart) {
    if (isFormEncoded) {
      throw methodError("Only one encoding annotation is allowed.");
    }
    isMultipart = true;
  } else if (annotation instanceof FormUrlEncoded) {
    if (isMultipart) {
      throw methodError("Only one encoding annotation is allowed.");
    }
    isFormEncoded = true;
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:40,代码来源:ServiceMethod.java

示例3: editComment

import retrofit2.http.PATCH; //导入依赖的package包/类
@NonNull @PATCH("repos/{owner}/{repo}/issues/comments/{commentId}")
@Headers("Accept: application/vnd.github.html,application/vnd.github.VERSION.raw")
Observable<Response<IssueEvent>> editComment(
        @Path("owner") String owner,
        @Path("repo") String repo,
        @Path("commentId") String commentId,
        @Body CommentRequestModel body
);
 
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:9,代码来源:IssueService.java

示例4: editIssue

import retrofit2.http.PATCH; //导入依赖的package包/类
@NonNull @PATCH("repos/{owner}/{repo}/issues/{issueNumber}")
@Headers("Accept: application/vnd.github.html,application/vnd.github.VERSION.raw")
Observable<Response<Issue>> editIssue(
        @Path("owner") String owner,
        @Path("repo") String repo,
        @Path("issueNumber") int issueNumber,
        @Body Issue body
);
 
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:9,代码来源:IssueService.java

示例5: patch

import retrofit2.http.PATCH; //导入依赖的package包/类
@PATCH("segment/patch")
Observable<ResponseBody> patch(@Query("query") String q);
 
开发者ID:ihsanbal,项目名称:LoggingInterceptor,代码行数:3,代码来源:Api.java

示例6:

import retrofit2.http.PATCH; //导入依赖的package包/类
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRetrys patch504" })
@PATCH("http/retry/504")
Observable<Response<ResponseBody>> patch504(@Body Boolean booleanValue);
 
开发者ID:Azure,项目名称:autorest.java,代码行数:4,代码来源:HttpRetrysImpl.java

示例7: editIssue

import retrofit2.http.PATCH; //导入依赖的package包/类
@PATCH("/issues/{issue_auth_token}")
Call<Issue> editIssue(@Header("Authorization") String authToken, @Body JsonObject editedIssue,
        @Path("issue_auth_token") String issueAuthToken);
 
开发者ID:ArnauBlanch,项目名称:civify-app,代码行数:4,代码来源:IssueService.java

示例8: patch

import retrofit2.http.PATCH; //导入依赖的package包/类
@FormUrlEncoded
@PATCH()
Observable<ResponseBody> patch(@Url() String url, @FieldMap Map<String, String> maps);
 
开发者ID:xiaoyaoyou1212,项目名称:XSnow,代码行数:4,代码来源:ApiService.java

示例9: heartbeat

import retrofit2.http.PATCH; //导入依赖的package包/类
@PATCH("sessions/{session}")
Call<Session> heartbeat(@Path("session") long id);
 
开发者ID:marnikitta,项目名称:Concierge,代码行数:3,代码来源:SessionClient.java

示例10: update

import retrofit2.http.PATCH; //导入依赖的package包/类
@PATCH("keys/{key}")
Call<StorageEntry> update(@Path("key") String key,
                          @Query("session") long session,
                          @Query("value") String value,
                          @Query("version") long version);
 
开发者ID:marnikitta,项目名称:Concierge,代码行数:6,代码来源:StorageClient.java

示例11: updateConsumerApplication

import retrofit2.http.PATCH; //导入依赖的package包/类
@PATCH("/consumers/{consumer_id}/oauth2/{id}")
Call<Application> updateConsumerApplication(@Path("consumer_id") String consumerId, @Path("id") String applicationId, @Body Application request);
 
开发者ID:vaibhav-sinha,项目名称:kong-java-client,代码行数:3,代码来源:RetrofitOAuth2ManageService.java

示例12: updateToken

import retrofit2.http.PATCH; //导入依赖的package包/类
@PATCH("/oauth2_tokens/{id}")
Call<Token> updateToken(@Path("id") String tokenId, @Body Token request);
 
开发者ID:vaibhav-sinha,项目名称:kong-java-client,代码行数:3,代码来源:RetrofitOAuth2ManageService.java

示例13: updatePluginForApi

import retrofit2.http.PATCH; //导入依赖的package包/类
@PATCH("/apis/{api}/plugins/{id}")
Call<Plugin> updatePluginForApi(@Path("api") String apiNameOrId, @Path("id") String pluginNameOrId, @Body Plugin request);
 
开发者ID:vaibhav-sinha,项目名称:kong-java-client,代码行数:3,代码来源:RetrofitApiPluginService.java

示例14: update

import retrofit2.http.PATCH; //导入依赖的package包/类
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.msi.UserAssignedIdentities update" })
@PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}")
Observable<Response<ResponseBody>> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body IdentityInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:4,代码来源:UserAssignedIdentitiesInner.java

示例15: updateCertificate

import retrofit2.http.PATCH; //导入依赖的package包/类
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.AppServiceCertificateOrders updateCertificate" })
@PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}")
Observable<Response<ResponseBody>> updateCertificate(@Path("resourceGroupName") String resourceGroupName, @Path("certificateOrderName") String certificateOrderName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body AppServiceCertificatePatchResourceInner keyVaultCertificate, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:4,代码来源:AppServiceCertificateOrdersInner.java


注:本文中的retrofit2.http.PATCH类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。