This repository has been archived by the owner on Feb 17, 2022. It is now read-only.
-
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.
Add Charset support to FoxHttpRequestBody (fix issue #5)
- Add Charset support to FoxHttpRequestBody - Add new annotation SerializeContentType which allows to set the content type in interface, method or model level - Update unit test to check for correct encoding
- Loading branch information
Showing
7 changed files
with
68 additions
and
8 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
11 changes: 11 additions & 0 deletions
11
src/main/java/ch/viascom/groundwork/foxhttp/annotation/types/SerializeContentType.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,11 @@ | ||
package ch.viascom.groundwork.foxhttp.annotation.types; | ||
|
||
import java.lang.annotation.*; | ||
|
||
@Documented | ||
@Target({ElementType.TYPE, ElementType.METHOD}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface SerializeContentType { | ||
String charset(); | ||
String mimetype(); | ||
} |
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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package ch.viascom.groundwork.foxhttp.models; | ||
|
||
import ch.viascom.groundwork.foxhttp.annotation.types.SerializeContentType; | ||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
|
@@ -8,6 +9,7 @@ | |
* @author [email protected] | ||
*/ | ||
@Data | ||
@SerializeContentType(mimetype = "application/json", charset = "UTF-8") | ||
public class User implements Serializable { | ||
private String username = "[email protected]"; | ||
private String firstname = "Fox"; | ||
|