retrofit2.http.POST类的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(227)

本文整理了Java中retrofit2.http.POST类的一些代码示例,展示了POST类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。POST类的具体详情如下:
包路径:retrofit2.http.POST
类名称:POST

POST介绍

暂无

代码示例

代码示例来源:origin: north2016/T-MVP

@Headers("Content-Type: image/png")
@POST("files/{name}")
Flowable<CreatedResult> upFile(@Path("name") String name, @Body RequestBody body);

代码示例来源:origin: Graylog2/graylog2-server

@POST("system/deflector/{indexSetId}/cycle")
  Call<Void> cycleIndexSet(@Path("indexSetId") String indexSetId);
}

代码示例来源:origin: square/retrofit

@POST("/")
Call<ResponseBody> sendNormal(@Body Repo repo);
@POST("/")

代码示例来源:origin: influxdata/influxdb-java

@POST("query")
public Call<QueryResult> postQuery(@Query(value = Q, encoded = true) String query);

代码示例来源:origin: allure-framework/allure2

@POST("api/2/issue/{issueKey}/comment")
Response<ResponseBody> createIssueComment(@Path("issueKey") String issueKey, @Body JiraIssueComment comment);

代码示例来源:origin: influxdata/influxdb-java

/**
 * @param username u: optional The username for authentication
 * @param password p: optional The password for authentication
 * @param database db: required The database to write points
 * @param retentionPolicy rp: optional The retention policy to write points.
 *                            If not specified, the autogen retention
 * @param precision optional The precision of the time stamps (n, u, ms, s, m, h).
 *                           If not specified, n
 * @param consistency optional The write consistency level required for the write to succeed.
 *                             Can be one of one, any, all, quorum. Defaults to all.
 */
@POST("write")
public Call<ResponseBody> writePoints(@Query(DB) String database,
  @Query(RP) String retentionPolicy, @Query(PRECISION) String precision,
  @Query(CONSISTENCY) String consistency, @Body RequestBody batchPoints);

代码示例来源:origin: hidroh/materialistic

@POST("repos/hidroh/materialistic/issues")
  @Headers("Authorization: token " + BuildConfig.GITHUB_TOKEN)
  Observable<Object> createGithubIssue(@Body Issue issue);
}

代码示例来源:origin: Graylog2/graylog2-server

@POST("system/shutdown/shutdown")
  Call<Void> shutdown();
}

代码示例来源:origin: chaychan/TouTiao

@Headers({
    "Content-Type:application/x-www-form-urlencoded; charset=UTF-8",
    "Cookie:PHPSESSIID=334267171504; _ga=GA1.2.646236375.1499951727; _gid=GA1.2.951962968.1507171739; Hm_lvt_e0a6a4397bcb500e807c5228d70253c8=1507174305;Hm_lpvt_e0a6a4397bcb500e807c5228d70253c8=1507174305; _gat=1",
    "Origin:http://toutiao.iiilab.com"
})
@POST("https://www.parsevideo.com/api.php")
Observable<VideoPathResponse> parseVideo(@Query("url") String url,@Query("hash")String hash);

代码示例来源:origin: ribot/ribot-app-android

@POST("/beacons/{beaconId}/encounters")
Observable<Encounter> performBeaconEncounter(@Header(AUTH_HEADER) String authorization,
                @Path("beaconId") String beaconId);

代码示例来源:origin: ribot/ribot-app-android

@POST("check-ins")
Observable<CheckIn> checkIn(@Header(AUTH_HEADER) String authorization,
              @Body CheckInRequest checkInRequest);

代码示例来源:origin: line/armeria

@POST("/postCustomContentType")
CompletableFuture<Response<Void>> postCustomContentType(
    @Header("Content-Type") @Nullable String contentType);

代码示例来源:origin: square/retrofit

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);
 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(method, "@Headers annotation is empty.");

代码示例来源:origin: GcsSloop/diycode

/**
 * 屏蔽用户
 *
 * @param login_name 登录用户名(非昵称)
 * @return 状态
 */
@Deprecated
@POST("users/{login}/block.json")
Call<State> blockUser(@Path("login") String login_name);

代码示例来源:origin: Graylog2/graylog2-server

@POST("system/jobs")
  Call trigger(@Body TriggerRequest tr);
}

代码示例来源:origin: influxdata/influxdb-java

@POST("query")
public Call<QueryResult> postQuery(@Query(DB) String db,
  @Query(value = Q, encoded = true) String query);

代码示例来源:origin: line/armeria

@POST("/post")
@Headers("content-type: application/json; charset=UTF-8")
CompletableFuture<Response<Void>> post(@Body Pojo pojo);

代码示例来源:origin: Graylog2/graylog2-server

@POST("system/deflector/cycle")
Call<Void> cycle();

代码示例来源:origin: com.squareup.retrofit2/retrofit

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);
 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(method, "@Headers annotation is empty.");

代码示例来源:origin: gradle.plugin.ru.rambler.jiratasksupdater/gradle-plugin

@POST("rest/api/2/issue/{issueId}/transitions")
  @Headers("Content-Type: application/json")
  Call<ResponseBody> doTransition(@Path("issueId") String issueId,
                  @Header("Authorization") String basic,
                  @Body JiraIssue jiraIssue);
}

相关文章

POST类方法