Skip to content

Commit

Permalink
Add missing setBody import #726
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso committed Nov 9, 2024
1 parent 5f8db7b commit 3c0d8a5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions sandbox/src/commonMain/kotlin/com/example/api/KtorSamplesApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ interface KtorSamplesApi {

val test1: String

@POST("signup")
suspend fun sendReg(
@Body param: Parameters
): String

// client-submit-form
@POST("signup")
@FormUrlEncoded
suspend fun signup(
@Field("username", true) headers: String?,
@Field email: String,
@Field("password") password: String,
@Field("confirmation") confirmation: String,
@Field("names") names: List<String>
): String

// client-submit-form
@POST("signup")
@FormUrlEncoded
Expand All @@ -26,7 +42,18 @@ interface KtorSamplesApi {
@Field("username", encoded = true) email: List<String>
): String

@Multipart
@POST("upload")
suspend fun uploadFile(
@Part("description") description: String,
@Part("list") file: List<PartData>,
@PartMap() map: Map<String, PartData>
): String

@POST("upload")
suspend fun upload(
@Body map: MultiPartFormDataContent
)
}

data class Query(
Expand Down

0 comments on commit 3c0d8a5

Please sign in to comment.