Skip to content

Commit

Permalink
Merge branch 'main' into spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
Taz03 authored Apr 18, 2024
2 parents 236e2bf + cd929b5 commit d80a5f2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ dependencies {
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.17.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.0'

implementation 'com.github.mizosoft.methanol:methanol:1.7.0'

implementation 'io.vertx:vertx-web-client:4.5.7'
implementation 'io.vertx:vertx-core:4.5.7'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.javadiscord.jdi.internal.api;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.mizosoft.methanol.MultipartBodyPublisher;
import java.net.URLEncoder;
import java.net.http.HttpRequest;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -52,6 +54,17 @@ public DiscordRequestBuilder body(Map<String, Object> payload) {
return this;
}

public DiscordRequestBuilder body(HttpRequest.BodyPublisher body) {
this.body = body;
return this;
}

public DiscordRequestBuilder multipartBody(MultipartBodyPublisher body) {
this.body = body;
this.headers.put("Content-Type", "multipart/form-data");
return this;
}

public DiscordRequestBuilder get() {
this.method = HttpMethod.GET;
return this;
Expand Down

0 comments on commit d80a5f2

Please sign in to comment.