retrofit2.http.HEAD Java Examples

The following examples show how to use retrofit2.http.HEAD. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RetrofitServiceProcessor.java    From kaif-android with Apache License 2.0 5 votes vote down vote up
@Override
public Set<String> getSupportedAnnotationTypes() {
  Set<String> annotations = new LinkedHashSet<String>();
  annotations.add(GET.class.getCanonicalName());
  annotations.add(PUT.class.getCanonicalName());
  annotations.add(POST.class.getCanonicalName());
  annotations.add(DELETE.class.getCanonicalName());
  annotations.add(HEAD.class.getCanonicalName());
  return annotations;
}
 
Example #2
Source File: EsService.java    From wES with MIT License 4 votes vote down vote up
@HEAD("{index}/_alias/{name}")
public Call<Void> indices_exists_alias(@Path("index") String index, @Path("name") String name);
 
Example #3
Source File: NextcloudRetrofitServiceMethod.java    From Android-SingleSignOn with GNU General Public License v3.0 4 votes vote down vote up
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 POST) {
        parseHttpMethodAndPath("POST", ((POST) annotation).value(), true);
    } else if (annotation instanceof PUT) {
        parseHttpMethodAndPath("PUT", ((PUT) annotation).value(), true);
    } else if (annotation instanceof HEAD) {
        parseHttpMethodAndPath("HEAD", ((HEAD) annotation).value(), false);
    } else if (annotation instanceof HTTP) {
        HTTP http = (HTTP) annotation;
        parseHttpMethodAndPath(http.method(), http.path(), http.hasBody());
    } else if (annotation instanceof Multipart) {
        if (isFormEncoded) {
            throw methodError(method, "Only one encoding annotation is allowed.");
        }
        isMultipart = true;
    } else if (annotation instanceof FormUrlEncoded) {
        if (isMultipart) {
            throw methodError(method, "Only one encoding annotation is allowed.");
        }
        isFormEncoded = true;
    } else if (annotation instanceof Streaming) {
        Log.v(TAG, "streaming interface");
    } else if (annotation instanceof retrofit2.http.Headers) {
        String[] headersToParse = ((retrofit2.http.Headers) annotation).value();
        if (headersToParse.length == 0) {
            throw methodError(method, "@Headers annotation is empty.");
        }
        headers = parseHeaders(headersToParse);
    } else if(annotation instanceof FormUrlEncoded) {
        //formUrlEncoded = true;
        Log.v(TAG, "FormUrlEncoded request");
    } else if(annotation instanceof NextcloudAPI.FollowRedirects) {
        followRedirects = true;
    } else {
        throw new UnsupportedOperationException(String.valueOf(annotation));
    }
}
 
Example #4
Source File: RetrofitClientUrlTests.java    From spring-cloud-square with Apache License 2.0 4 votes vote down vote up
@HEAD("/head")
Call<Void> head();
 
Example #5
Source File: RetrofitMeterIdPrefixFunctionTest.java    From armeria with Apache License 2.0 4 votes vote down vote up
@HEAD("/foo")
CompletableFuture<Void> headFoo();
 
Example #6
Source File: EsService.java    From wES with MIT License 4 votes vote down vote up
@HEAD("")
public Call<Void> ping();
 
Example #7
Source File: EsService.java    From wES with MIT License 4 votes vote down vote up
@HEAD("{index}/_mapping/{type}")
public Call<Void> indices_exists_type(@Path("index") String index, @Path("type") String type);
 
Example #8
Source File: EsService.java    From wES with MIT License 4 votes vote down vote up
@HEAD("_template/{name}")
public Call<Void> indices_exists_template(@Path("name") String name);
 
Example #9
Source File: EsService.java    From wES with MIT License 4 votes vote down vote up
@HEAD("{index}/_alias")
public Call<Void> indices_exists_alias2(@Path("index") String index);
 
Example #10
Source File: ResourcesInner.java    From azure-libraries-for-java with MIT License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.Resources checkExistence" })
@HEAD("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}")
Observable<Response<Void>> checkExistence(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example #11
Source File: EsService.java    From wES with MIT License 4 votes vote down vote up
@HEAD("_alias/{name}")
public Call<Void> indices_exists_alias(@Path("name") String name);
 
Example #12
Source File: EsService.java    From wES with MIT License 4 votes vote down vote up
@HEAD("{index}")
public Call<Void> indices_exists(@Path("index") String index);
 
Example #13
Source File: EsService.java    From wES with MIT License 4 votes vote down vote up
@HEAD("{index}/{type}/{id}")
public Call<Void> exists(@Path("index") String index, @Path("type") String type, @Path("id") String id);
 
Example #14
Source File: IApiClient.java    From tenor-android-core with Apache License 2.0 4 votes vote down vote up
@HEAD
Call<Void> getImageSize(@Url String imageUrl);
 
Example #15
Source File: DatabaseAccountsInner.java    From azure-libraries-for-java with MIT License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts checkNameExists" })
@HEAD("providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}")
Observable<Response<Void>> checkNameExists(@Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example #16
Source File: ResourceGroupsInner.java    From azure-libraries-for-java with MIT License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.ResourceGroups checkExistence" })
@HEAD("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}")
Observable<Response<Void>> checkExistence(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example #17
Source File: ResourcesInner.java    From azure-libraries-for-java with MIT License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.Resources checkExistenceById" })
@HEAD("{resourceId}")
Observable<Response<Void>> checkExistenceById(@Path(value = "resourceId", encoded = true) String resourceId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);