Java Code Examples for retrofit2.http.Url

The following are top voted examples for showing how to use retrofit2.http.Url. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: GitHub   File: RequestBuilderTest.java   Source Code and License 6 votes vote down vote up
@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");
  }
}
 
Example 2
Project: GitHub   File: RequestBuilderTest.java   Source Code and License 5 votes vote down vote up
@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();
}
 
Example 3
Project: azure-libraries-for-java   File: ZonesInner.java   Source Code and License 4 votes vote down vote up
@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);
 
Example 4
Project: AndroidBasicLibs   File: ApiService.java   Source Code and License 4 votes vote down vote up
@Multipart
@POST()
Observable<ResponseBody> uploadFile(@Url String fileUrl,
                                    @Part("description") RequestBody description, @Part("files") MultipartBody.Part file);
 
Example 5
Project: smart-asset-iot-android-demo   File: Register.java   Source Code and License 4 votes vote down vote up
@POST
@Headers({"ContentType: application/json", "Authorization:" + Const.KEY})
Call<RegisterData> register(@Url String url, @Body RegisterBody body);
 
Example 6
Project: JD-Test   File: BaseApiService.java   Source Code and License 4 votes vote down vote up
@GET()
Observable<ResponseBody> executeGet(
        @Url String url,
        @QueryMap Map<String, Object> maps);
 
Example 7
Project: richeditor   File: UploadHelper.java   Source Code and License 4 votes vote down vote up
@Multipart
@POST
Observable<ResponseBody> uploadFile(@Url String url, @Part MultipartBody.Part file);
 
Example 8
Project: retrofit-OurRetrofit   File: HttpUtil.java   Source Code and License 4 votes vote down vote up
@FormUrlEncoded
@POST
Call<ResponseBody> post(@Url String url, @HeaderMap Map<String, String> headers, @FieldMap Map<String, Object> param);
 
Example 9
Project: azure-libraries-for-java   File: TrustedIdProvidersImpl.java   Source Code and License 4 votes vote down vote up
@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);
 
Example 10
Project: Bing   File: RestService.java   Source Code and License 4 votes vote down vote up
@DELETE
Call<String> delete(@Url String url, @QueryMap WeakHashMap<String, Object> params);
 
Example 11
Project: azure-libraries-for-java   File: ObjectsInner.java   Source Code and License 4 votes vote down vote up
@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);
 
Example 12
Project: azure-libraries-for-java   File: FeaturesInner.java   Source Code and License 4 votes vote down vote up
@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);
 
Example 13
Project: azure-libraries-for-java   File: HybridConnectionsInner.java   Source Code and License 4 votes vote down vote up
@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);
 
Example 14
Project: XSnow   File: ApiService.java   Source Code and License 4 votes vote down vote up
@OPTIONS()
Observable<ResponseBody> options(@Url String url, @QueryMap Map<String, String> maps);
 
Example 15
Project: JD-Test   File: BaseApiService.java   Source Code and License 4 votes vote down vote up
@FormUrlEncoded
@POST()
Flowable<ResponseBody> postForm(
        @Url() String url,
        @FieldMap Map<String, Object> maps);
 
Example 16
Project: azure-libraries-for-java   File: JobCollectionsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.JobCollections listByResourceGroupNext" })
@GET
Observable<Response<ResponseBody>> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 17
Project: azure-libraries-for-java   File: WebhooksInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.WebhookOperations listEventsNext" })
@GET
Observable<Response<ResponseBody>> listEventsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 18
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps listDomainOwnershipIdentifiersNext" })
@GET
Observable<Response<ResponseBody>> listDomainOwnershipIdentifiersNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 19
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps listWebJobsNext" })
@GET
Observable<Response<ResponseBody>> listWebJobsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 20
Project: azure-libraries-for-java   File: AppServiceEnvironmentsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.AppServiceEnvironments listMetricsNext" })
@GET
Observable<Response<ResponseBody>> listMetricsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 21
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps listInstanceIdentifiersSlotNext" })
@GET
Observable<Response<ResponseBody>> listInstanceIdentifiersSlotNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 22
Project: MyEyepetizer   File: FoundApi.java   Source Code and License 4 votes vote down vote up
@GET
Observable<GetDataBean> getFoundCategoryData(@Url String url);
 
Example 23
Project: autorest.java   File: PagingsImpl.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getOdataMultiplePagesNext" })
@GET
Observable<Response<ResponseBody>> getOdataMultiplePagesNext(@Url String nextUrl, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent);
 
Example 24
Project: GitHub   File: DownloadApi.java   Source Code and License 4 votes vote down vote up
@GET
@Streaming
Flowable<Response<ResponseBody>> download(@Header("Range") String range,
                                          @Url String url);
 
Example 25
Project: GitHub   File: DownloadApi.java   Source Code and License 4 votes vote down vote up
@HEAD
Observable<Response<Void>> check(@Url String url);
 
Example 26
Project: azure-libraries-for-java   File: VaultsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.keyvault.Vaults listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 27
Project: RxEasyHttp   File: ApiService.java   Source Code and License 4 votes vote down vote up
@PUT()
Observable<ResponseBody> put(@Url String url, @QueryMap Map<String, String> maps);
 
Example 28
Project: GitHub   File: DownloadApi.java   Source Code and License 4 votes vote down vote up
@HEAD
Observable<Response<Void>> checkFileByHead(@Header("If-Modified-Since") String lastModify,
                                           @Url String url);
 
Example 29
Project: azure-libraries-for-java   File: DataLakeStoreAccountsImpl.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datalake.analytics.DataLakeStoreAccounts listByAccountNext" })
@GET
Observable<Response<ResponseBody>> listByAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 30
Project: azure-libraries-for-java   File: InteractionsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.customerinsights.Interactions listByHubNext" })
@GET
Observable<Response<ResponseBody>> listByHubNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 31
Project: azure-libraries-for-java   File: ProfilesInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles listResourceUsageNext" })
@GET
Observable<Response<ResponseBody>> listResourceUsageNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 32
Project: autorest.java   File: PagingsImpl.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesWithOffsetNext" })
@GET
Observable<Response<ResponseBody>> getMultiplePagesWithOffsetNext(@Url String nextUrl, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent);
 
Example 33
Project: autorest.java   File: PagingsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings nextFragmentWithGrouping" })
@GET
Observable<Response<ResponseBody>> nextFragmentWithGrouping(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Query("api_version") String apiVersion, @Header("User-Agent") String userAgent);
 
Example 34
Project: AndroidRequest   File: RetrofitHttpService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET()
Call<ResponseBody> download(@HeaderMap Map<String, String> headers, @Url String url, @QueryMap Map<String, String> params);
 
Example 35
Project: AndroidRequest   File: RetrofitHttpService.java   Source Code and License 4 votes vote down vote up
@FormUrlEncoded
@POST()
Call<String> post(@HeaderMap Map<String, String> headers, @Url String url, @FieldMap Map<String, String> params);
 
Example 36
Project: azure-libraries-for-java   File: RolesInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.customerinsights.Roles listByHubNext" })
@GET
Observable<Response<ResponseBody>> listByHubNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 37
Project: azure-libraries-for-java   File: DiagnosticsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Diagnostics listSiteDetectorsSlotNext" })
@GET
Observable<Response<ResponseBody>> listSiteDetectorsSlotNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 38
Project: azure-libraries-for-java   File: VirtualMachineScaleSetsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineScaleSets listByResourceGroupNext" })
@GET
Observable<Response<ResponseBody>> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 39
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps listPerfMonCountersSlotNext" })
@GET
Observable<Response<ResponseBody>> listPerfMonCountersSlotNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 40
Project: in-store-api-java-sdk   File: PersistenceProtoCore.java   Source Code and License 4 votes vote down vote up
@Override
default Observable<Response<ResponseBody>> getObject(@Url String url) {
    return getProtoCoreProvider().getProtocore().getObject(url);
}
 
Example 41
Project: azure-libraries-for-java   File: ReplicationsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.Replications listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 42
Project: azure-libraries-for-java   File: NamespacesInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces listAllNext" })
@GET
Observable<Response<ResponseBody>> listAllNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 43
Project: retrofit-OurRetrofit   File: HttpUtil.java   Source Code and License 4 votes vote down vote up
@Multipart
@POST
Call<String> postUpload(@Url String url, @Part("filedes") String des, @PartMap Map<String, RequestBody> params);
 
Example 44
Project: azure-libraries-for-java   File: SubnetsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.Subnets listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 45
Project: mvvm-template   File: UserRestService.java   Source Code and License 4 votes vote down vote up
@GET
Single<String> getContributions(@Url String url);
 
Example 46
Project: MyEyepetizer   File: FollowApi.java   Source Code and License 4 votes vote down vote up
@GET
Observable<GetDataBean> loadMoreData(@Url String url);
 
Example 47
Project: XSnow   File: ApiService.java   Source Code and License 4 votes vote down vote up
@POST()
Observable<ResponseBody> postBody(@Url() String url, @Body RequestBody requestBody);
 
Example 48
Project: AndroidBasicLibs   File: ApiService.java   Source Code and License 4 votes vote down vote up
@PUT()
Observable<ResponseBody> put(@Url() String url, @QueryMap Map<String, String> maps);
 
Example 49
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps listBackupsSlotNext" })
@GET
Observable<Response<ResponseBody>> listBackupsSlotNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 50
Project: azure-libraries-for-java   File: QueuesInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.Queues listByNamespaceNext" })
@GET
Observable<Response<ResponseBody>> listByNamespaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 51
Project: azure-libraries-for-java   File: RegistriesInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.Registries listByResourceGroupNext" })
@GET
Observable<Response<ResponseBody>> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 52
Project: azure-libraries-for-java   File: EndpointsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints listByProfileNext" })
@GET
Observable<Response<ResponseBody>> listByProfileNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 53
Project: azure-libraries-for-java   File: RedisInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.redis.Redis listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 54
Project: azure-libraries-for-java   File: RecordSetsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.dns.RecordSets listByTypeNext" })
@GET
Observable<Response<ResponseBody>> listByTypeNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 55
Project: GSB-2017-Android   File: SuppliersService.java   Source Code and License 4 votes vote down vote up
@POST
Observable<JsonElement> addSupplier(@Url String url, @Body Supplier supplier);
 
Example 56
Project: azure-libraries-for-java   File: VirtualMachineScaleSetExtensionsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineScaleSetExtensions listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 57
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps listProcessesNext" })
@GET
Observable<Response<ResponseBody>> listProcessesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 58
Project: Ec2m   File: RetrofitService.java   Source Code and License 4 votes vote down vote up
@POST("{url}")
Observable<BaseCallModel> executePost(
        @Url String url,
        //  @Header("") String authorization,
        @QueryMap Map<String, String> maps);
 
Example 59
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps listHostNameBindingsSlotNext" })
@GET
Observable<Response<ResponseBody>> listHostNameBindingsSlotNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 60
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps listProcessThreadsSlotNext" })
@GET
Observable<Response<ResponseBody>> listProcessThreadsSlotNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);