當前位置: 首頁>>代碼示例>>Java>>正文


Java Url類代碼示例

本文整理匯總了Java中retrofit2.http.Url的典型用法代碼示例。如果您正苦於以下問題:Java Url類的具體用法?Java Url怎麽用?Java Url使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Url類屬於retrofit2.http包,在下文中一共展示了Url類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getWithNonStringUrlThrows

import retrofit2.http.Url; //導入依賴的package包/類
@Test public void getWithNonStringUrlThrows() {
  class Example {
    @GET
    Call<ResponseBody> method(@Url Object url) {
      return null;
    }
  }

  try {
    buildRequest(Example.class, "foo/bar");
    fail();
  } catch (IllegalArgumentException e) {
    assertThat(e).hasMessage(
        "@Url must be okhttp3.HttpUrl, String, java.net.URI, or android.net.Uri type."
            + " (parameter #1)\n"
            + "    for method Example.method");
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:19,代碼來源:RequestBuilderTest.java

示例2: getWithUrlAbsoluteSameHost

import retrofit2.http.Url; //導入依賴的package包/類
@Test public void getWithUrlAbsoluteSameHost() {
  class Example {
    @GET
    Call<ResponseBody> method(@Url String url) {
      return null;
    }
  }

  Request request = buildRequest(Example.class, "http://example.com/foo/bar/");
  assertThat(request.method()).isEqualTo("GET");
  assertThat(request.headers().size()).isZero();
  assertThat(request.url().toString()).isEqualTo("http://example.com/foo/bar/");
  assertThat(request.body()).isNull();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:RequestBuilderTest.java

示例3: listNext

import retrofit2.http.Url; //導入依賴的package包/類
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.dns.Zones listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
開發者ID:Azure,項目名稱:azure-libraries-for-java,代碼行數:4,代碼來源:ZonesInner.java

示例4: uploadFile

import retrofit2.http.Url; //導入依賴的package包/類
@Multipart
@POST()
Observable<ResponseBody> uploadFile(@Url String fileUrl,
                                    @Part("description") RequestBody description, @Part("files") MultipartBody.Part file);
 
開發者ID:jeasinlee,項目名稱:AndroidBasicLibs,代碼行數:5,代碼來源:ApiService.java

示例5: register

import retrofit2.http.Url; //導入依賴的package包/類
@POST
@Headers({"ContentType: application/json", "Authorization:" + Const.KEY})
Call<RegisterData> register(@Url String url, @Body RegisterBody body);
 
開發者ID:BANKEX,項目名稱:smart-asset-iot-android-demo,代碼行數:4,代碼來源:Register.java

示例6: executeGet

import retrofit2.http.Url; //導入依賴的package包/類
@GET()
Observable<ResponseBody> executeGet(
        @Url String url,
        @QueryMap Map<String, Object> maps);
 
開發者ID:liu-xiao-dong,項目名稱:JD-Test,代碼行數:5,代碼來源:BaseApiService.java

示例7: uploadFile

import retrofit2.http.Url; //導入依賴的package包/類
@Multipart
@POST
Observable<ResponseBody> uploadFile(@Url String url, @Part MultipartBody.Part file);
 
開發者ID:nowandfurure,項目名稱:richeditor,代碼行數:4,代碼來源:UploadHelper.java

示例8: post

import retrofit2.http.Url; //導入依賴的package包/類
@FormUrlEncoded
@POST
Call<ResponseBody> post(@Url String url, @HeaderMap Map<String, String> headers, @FieldMap Map<String, Object> param);
 
開發者ID:yy941002,項目名稱:retrofit-OurRetrofit,代碼行數:4,代碼來源:HttpUtil.java

示例9: listByAccountNext

import retrofit2.http.Url; //導入依賴的package包/類
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalake.store.TrustedIdProviders listByAccountNext" })
@GET
Observable<Response<ResponseBody>> listByAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
開發者ID:Azure,項目名稱:azure-libraries-for-java,代碼行數:4,代碼來源:TrustedIdProvidersImpl.java

示例10: delete

import retrofit2.http.Url; //導入依賴的package包/類
@DELETE
Call<String> delete(@Url String url, @QueryMap WeakHashMap<String, Object> params);
 
開發者ID:wang2016215,項目名稱:Bing,代碼行數:3,代碼來源:RestService.java

示例11: getObjectsByObjectIdsNext

import retrofit2.http.Url; //導入依賴的package包/類
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.graphrbac.Objects getObjectsByObjectIdsNext" })
@GET
Observable<Response<ResponseBody>> getObjectsByObjectIdsNext(@Url String nextUrl, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
開發者ID:Azure,項目名稱:azure-libraries-for-java,代碼行數:4,代碼來源:ObjectsInner.java

示例12: list1Next

import retrofit2.http.Url; //導入依賴的package包/類
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.Features list1Next" })
@GET
Observable<Response<ResponseBody>> list1Next(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
開發者ID:Azure,項目名稱:azure-libraries-for-java,代碼行數:4,代碼來源:FeaturesInner.java

示例13: listAuthorizationRulesNext

import retrofit2.http.Url; //導入依賴的package包/類
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.relay.HybridConnections listAuthorizationRulesNext" })
@GET
Observable<Response<ResponseBody>> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
開發者ID:Azure,項目名稱:azure-libraries-for-java,代碼行數:4,代碼來源:HybridConnectionsInner.java

示例14: options

import retrofit2.http.Url; //導入依賴的package包/類
@OPTIONS()
Observable<ResponseBody> options(@Url String url, @QueryMap Map<String, String> maps);
 
開發者ID:xiaoyaoyou1212,項目名稱:XSnow,代碼行數:3,代碼來源:ApiService.java

示例15: postForm

import retrofit2.http.Url; //導入依賴的package包/類
@FormUrlEncoded
@POST()
Flowable<ResponseBody> postForm(
        @Url() String url,
        @FieldMap Map<String, Object> maps);
 
開發者ID:liu-xiao-dong,項目名稱:JD-Test,代碼行數:6,代碼來源:BaseApiService.java


注:本文中的retrofit2.http.Url類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。