Skip to content

Commit

Permalink
Add Headers on Get. (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
iNoles authored Apr 19, 2023
1 parent c858ec1 commit c431787
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion fuel/src/commonMain/kotlin/fuel/Fuels.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package fuel

public suspend fun Fuel.get(
url: String,
parameters: Parameters? = null
parameters: Parameters? = null,
headers: Map<String, String> = emptyMap()
): HttpResponse = loader().get(
Request.Builder()
.url(url)
.parameters(parameters)
.headers(headers)
.build()
)

Expand Down
6 changes: 4 additions & 2 deletions fuel/src/commonMain/kotlin/fuel/Strings.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package fuel

public suspend fun String.httpGet(
parameters: Parameters? = null
): HttpResponse = Fuel.get(this, parameters)
parameters: Parameters? = null,
headers: Map<String, String> = emptyMap()
): HttpResponse =
Fuel.get(this, parameters, headers)

public suspend fun String.httpPost(
parameters: Parameters? = null,
Expand Down

0 comments on commit c431787

Please sign in to comment.