當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。