Skip to content

Commit 3c0d8a5

Browse files
committed
Add missing setBody import #726
1 parent 5f8db7b commit 3c0d8a5

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

sandbox/src/commonMain/kotlin/com/example/api/KtorSamplesApi.kt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ interface KtorSamplesApi {
1818

1919
val test1: String
2020

21+
@POST("signup")
22+
suspend fun sendReg(
23+
@Body param: Parameters
24+
): String
25+
26+
// client-submit-form
27+
@POST("signup")
28+
@FormUrlEncoded
29+
suspend fun signup(
30+
@Field("username", true) headers: String?,
31+
@Field email: String,
32+
@Field("password") password: String,
33+
@Field("confirmation") confirmation: String,
34+
@Field("names") names: List<String>
35+
): String
36+
2137
// client-submit-form
2238
@POST("signup")
2339
@FormUrlEncoded
@@ -26,7 +42,18 @@ interface KtorSamplesApi {
2642
@Field("username", encoded = true) email: List<String>
2743
): String
2844

45+
@Multipart
46+
@POST("upload")
47+
suspend fun uploadFile(
48+
@Part("description") description: String,
49+
@Part("list") file: List<PartData>,
50+
@PartMap() map: Map<String, PartData>
51+
): String
2952

53+
@POST("upload")
54+
suspend fun upload(
55+
@Body map: MultiPartFormDataContent
56+
)
3057
}
3158

3259
data class Query(

0 commit comments

Comments
 (0)