-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from sashirestela/46-extend-interceptor-to-han…
…dle-body-request Extend interceptor to handle body request
- Loading branch information
Showing
11 changed files
with
273 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/io/github/sashirestela/cleverclient/http/HttpRequestData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.github.sashirestela.cleverclient.http; | ||
|
||
import java.util.Map; | ||
|
||
import io.github.sashirestela.cleverclient.support.ContentType; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Builder | ||
@Getter | ||
public class HttpRequestData { | ||
@Setter private String url; | ||
@Setter private Object body; | ||
@Setter private Map<String, String> headers; | ||
private String httpMethod; | ||
private ContentType contentType; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/io/github/sashirestela/cleverclient/support/ContentType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.github.sashirestela.cleverclient.support; | ||
|
||
import io.github.sashirestela.cleverclient.util.Constant; | ||
|
||
public enum ContentType { | ||
MULTIPART_FORMDATA( | ||
"multipart/form-data", | ||
"; boundary=\"" + Constant.BOUNDARY_VALUE + "\""), | ||
APPLICATION_JSON( | ||
"application/json", | ||
""); | ||
|
||
private String mimeType; | ||
private String details; | ||
|
||
ContentType(String mimeType, String details) { | ||
this.mimeType = mimeType; | ||
this.details = details; | ||
} | ||
|
||
public String getMimeType() { | ||
return this.mimeType; | ||
} | ||
|
||
public String getDetails() { | ||
return this.details; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.