本文整理匯總了Java中retrofit2.http.Body類的典型用法代碼示例。如果您正苦於以下問題:Java Body類的具體用法?Java Body怎麽用?Java Body使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Body類屬於retrofit2.http包,在下文中一共展示了Body類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: uploadImage4search
import retrofit2.http.Body; //導入依賴的package包/類
@Headers({
"Accept:*/*",
"Accept-Encoding:gzip, deflate",
"Accept-Language:zh-CN,zh;q=0.8",
"Connection:keep-alive",
"Content-Type:text/plain",
"User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36",
"X-Requested-With:XMLHttpRequest"
})
@POST("api/upload/auto?")
Observable<ImageUpload> uploadImage4search(@Query("name") String name, @Query("type") String type, @Body String imgs);
示例2: bodyRequired
import retrofit2.http.Body; //導入依賴的package包/類
@Test public void bodyRequired() {
class Example {
@POST("/foo/bar/") //
Call<ResponseBody> method(@Body RequestBody body) {
return null;
}
}
try {
buildRequest(Example.class, new Object[] { null });
fail();
} catch (IllegalArgumentException e) {
assertThat(e.getMessage()).isEqualTo("Body parameter value must not be null.");
}
}
示例3: sendFriendInvitation
import retrofit2.http.Body; //導入依賴的package包/類
@POST("friendship/invite")
Observable<FriendInvitationResponse> sendFriendInvitation(@Body RequestBody body);
示例4: beginCreateFunction
import retrofit2.http.Body; //導入依賴的package包/類
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps beginCreateFunction" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}")
Observable<Response<ResponseBody>> beginCreateFunction(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("functionName") String functionName, @Path("subscriptionId") String subscriptionId, @Body FunctionEnvelopeInner functionEnvelope, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
示例5: getShopInfo
import retrofit2.http.Body; //導入依賴的package包/類
@POST("/api/sale/shop/info")
Observable<ShopInfoResponse> getShopInfo(@Body EmptyRequest emptyRequest);
示例6: beginUpdate
import retrofit2.http.Body; //導入依賴的package包/類
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints beginUpdate" })
@PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}")
Observable<Response<ResponseBody>> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointUpdateParametersInner endpointUpdateProperties, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
示例7: regenerateKey
import retrofit2.http.Body; //導入依賴的package包/類
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts regenerateKey" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey")
Observable<Response<ResponseBody>> regenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabaseAccountRegenerateKeyParameters keyToRegenerate, @Header("User-Agent") String userAgent);
示例8: updateApplicationAttributes
import retrofit2.http.Body; //導入依賴的package包/類
@Headers({ "Accept: application/json", "Content-Type:application/json" })
@PUT("api/v1/projectVersions/{parentId}/attributes")
Call<ResponseBody> updateApplicationAttributes(@Path("parentId") int parentId, @Body List<UpdateFortifyApplicationAttributesRequest> request);
開發者ID:blackducksoftware,項目名稱:hub-fortify-ssc-integration-service,代碼行數:4,代碼來源:FortifyApplicationVersionApiService.java
示例9: update
import retrofit2.http.Body; //導入依賴的package包/類
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.streamanalytics.StreamingJobs update" })
@PATCH("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}")
Observable<Response<ResponseBody>> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @Body StreamingJobInner streamingJob, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
示例10: getWalletPubKey
import retrofit2.http.Body; //導入依賴的package包/類
@Headers({"Content-Type: application/json","User-Agent: JPascalCoin"})
@POST("/")
Call<OpResult<PublicKey>> getWalletPubKey(@Body Map<String, Object> body);
示例11: login
import retrofit2.http.Body; //導入依賴的package包/類
@GET
Observable<LoginResponse> login(@Body LoginRequest request);
示例12: cardCheckoutValidate
import retrofit2.http.Body; //導入依賴的package包/類
@POST("card/checkout/validate")
Call<CheckoutValidateResponse> cardCheckoutValidate(@Body HashMap<String, Object> body);
示例13: sendChunked
import retrofit2.http.Body; //導入依賴的package包/類
@POST("/")
Call<ResponseBody> sendChunked(@Chunked @Body Repo repo);
示例14: toggleReplyFavourite
import retrofit2.http.Body; //導入依賴的package包/類
@POST("activity/reply/like")
Call<ResponseBody> toggleReplyFavourite(@Body Payload.ActionIdBased payload);
示例15: beginGrantAccess
import retrofit2.http.Body; //導入依賴的package包/類
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.Disks beginGrantAccess" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess")
Observable<Response<ResponseBody>> beginGrantAccess(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("diskName") String diskName, @Query("api-version") String apiVersion, @Body GrantAccessDataInner grantAccessData, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);