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


Java DELETE类代码示例

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


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

示例1: extractPath

import retrofit2.http.DELETE; //导入依赖的package包/类
private static String extractPath(Element element) throws NoAnnotationException {
    GET getAnnotation = element.getAnnotation(GET.class);
    if (getAnnotation != null) {
        return getAnnotation.value();
    }

    POST postAnnotation = element.getAnnotation(POST.class);
    if (postAnnotation != null) {
        return postAnnotation.value();
    }

    DELETE deleteAnnotation = element.getAnnotation(DELETE.class);
    if (deleteAnnotation != null) {
        return deleteAnnotation.value();
    }

    PUT putAnnotation = element.getAnnotation(PUT.class);
    if (putAnnotation != null) {
        return putAnnotation.value();
    }

    throw new NoAnnotationException();
}
 
开发者ID:car2go,项目名称:Endpoint2mock2,代码行数:24,代码来源:MockAnnotationProccessor.java

示例2: parseMethodAnnotation

import retrofit2.http.DELETE; //导入依赖的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: delete

import retrofit2.http.DELETE; //导入依赖的package包/类
@Test public void delete() {
  class Example {
    @DELETE("/foo/bar/") //
    Call<ResponseBody> method() {
      return null;
    }
  }
  Request request = buildRequest(Example.class);
  assertThat(request.method()).isEqualTo("DELETE");
  assertThat(request.headers().size()).isZero();
  assertThat(request.url().toString()).isEqualTo("http://example.com/foo/bar/");
  assertNull(request.body());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:RequestBuilderTest.java

示例4: contentTypeAnnotationHeaderAddsHeaderWithNoBody

import retrofit2.http.DELETE; //导入依赖的package包/类
@Test public void contentTypeAnnotationHeaderAddsHeaderWithNoBody() {
  class Example {
    @DELETE("/") //
    @Headers("Content-Type: text/not-plain") //
    Call<ResponseBody> method() {
      return null;
    }
  }
  Request request = buildRequest(Example.class);
  assertThat(request.headers().get("Content-Type")).isEqualTo("text/not-plain");
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:RequestBuilderTest.java

示例5: removeFromCollection

import retrofit2.http.DELETE; //导入依赖的package包/类
@DELETE("/users/{username}/collection/folders/1/releases/{release_id}/instances/{instance_id}")
Single<Response<Void>> removeFromCollection(@Path("username") String username, @Path("release_id") String releaseId, @Path("instance_id") String instanceId);
 
开发者ID:jbmlaird,项目名称:DiscogsBrowser,代码行数:3,代码来源:DiscogsService.java

示例6: removeFromWantlist

import retrofit2.http.DELETE; //导入依赖的package包/类
@DELETE("/users/{username}/wants/{release_id}")
Single<Response<Void>> removeFromWantlist(@Path("username") String username, @Path("release_id") String releaseId);
 
开发者ID:jbmlaird,项目名称:DiscogsBrowser,代码行数:3,代码来源:DiscogsService.java

示例7: deleteAddress

import retrofit2.http.DELETE; //导入依赖的package包/类
@Headers({HEADER_API_VERSION})
@DELETE("customer/address")
Observable<BaseJson<String>> deleteAddress(@Query("id") int id);
 
开发者ID:Zyj163,项目名称:yyox,代码行数:4,代码来源:AddressService.java

示例8: deleteCsar

import retrofit2.http.DELETE; //导入依赖的package包/类
@DELETE("/api/csars/{csarName}/delete")
Call<ResponseBody> deleteCsar(
    @Path("csarName") String name
);
 
开发者ID:StuPro-TOSCAna,项目名称:TOSCAna,代码行数:5,代码来源:TOSCAnaAPIService.java

示例9: deleteTransformation

import retrofit2.http.DELETE; //导入依赖的package包/类
@DELETE("/api/csars/{csarName}/transformations/{platform}/delete")
Call<ResponseBody> deleteTransformation(
    @Path("csarName") String csarName,
    @Path("platform") String platform
);
 
开发者ID:StuPro-TOSCAna,项目名称:TOSCAna,代码行数:6,代码来源:TOSCAnaAPIService.java

示例10: unlikeShot

import retrofit2.http.DELETE; //导入依赖的package包/类
@DELETE("/v1/shots/{shot_id}/like")
Observable<Response<ShotLike>> unlikeShot(@Path("shot_id") long shotId);
 
开发者ID:gejiaheng,项目名称:Protein,代码行数:3,代码来源:ShotsService.java

示例11: unfollow

import retrofit2.http.DELETE; //导入依赖的package包/类
@DELETE("/v1/users/{user_id}/follow")
Observable<Response<Body>> unfollow(@Path("user_id") long userId);
 
开发者ID:gejiaheng,项目名称:Protein,代码行数:3,代码来源:UserService.java

示例12: delete

import retrofit2.http.DELETE; //导入依赖的package包/类
@DELETE("{handle}")
Call<ResponseBody> delete(
    @Path("handle") String handle,
    @Query("key") String key,
    @Query("policy") String policy,
    @Query("signature") String signature);
 
开发者ID:filestack,项目名称:filestack-java,代码行数:7,代码来源:BaseService.java

示例13: unlike

import retrofit2.http.DELETE; //导入依赖的package包/类
@DELETE("photos/{id}/like")
Flowable<Response<LikeResult>> unlike(@Path("id") String id);
 
开发者ID:alphater,项目名称:garras,代码行数:3,代码来源:PixelsApis.java

示例14: deleteCollection

import retrofit2.http.DELETE; //导入依赖的package包/类
@DELETE("collections/{id}")
Flowable<DeleteCollectionResult> deleteCollection(@Path("id") int id);
 
开发者ID:alphater,项目名称:garras,代码行数:3,代码来源:PixelsApis.java

示例15: deletePhotoFromCollection

import retrofit2.http.DELETE; //导入依赖的package包/类
@DELETE("collections/{collection_id}/remove")
Flowable<ChangeCollectionPhotoResult> deletePhotoFromCollection(@Path("collection_id") int collection_id,
                                                                @Query("photo_id") String photo_id);
 
开发者ID:alphater,项目名称:garras,代码行数:4,代码来源:PixelsApis.java


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