You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-2Lines changed: 18 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -85,12 +85,15 @@ docker compose up
85
85
86
86
# Maven
87
87
88
+
88
89
...
89
90
91
+
<!-- Remove these when all points ready here
90
92
91
-
<detailsstyle="visibility:hidden">
93
+
<details>
92
94
<summary id="problem1">Weird Feature 1.</summary>
93
95
96
+
//TODO tee tähän johtopäätös https://countriesnow.space/api/v0.1/countries/population
94
97
95
98
- I came to notice when making **POST** request to the address of `https://countriesnow.space/api/v0.1/countries/population` it would work for **PostMan**, but not for **ReactorNetty**.
96
99
@@ -104,7 +107,7 @@ docker compose up
104
107
105
108
- Due to the inspections how PostMan had it working with this API. It had following settings `Accept: */*`.
106
109
107
-
- Luckily returning `Mono<String>` from **POST** function and changing NettyReactor headers to `"Accept", MediaType.ALL_VALUE` from `"Accept", MediaType.APPLICATION_JSON_VALUE`(since API gives JSON), gave me positive surprise.
110
+
- Luckily returning `Mono<String>` from **POST** function and setting `@Data` with POST param DTO class with the changing **NettyReactor** headers to `"Accept", MediaType.ALL_VALUE` from `"Accept", MediaType.APPLICATION_JSON_VALUE`(since API gives JSON), gave me positive surprise.
108
111
109
112
110
113
```
@@ -116,11 +119,24 @@ docker compose up
116
119
}
117
120
```
118
121
122
+
- With DTO class.
123
+
124
+
```
125
+
@Data
126
+
@AllArgsConstructor
127
+
public class ParamClass {
128
+
String country;
129
+
}
130
+
```
119
131
- Below positive surprise. I was not crazy and seeing things.
- Also, WebClient started to worked normally after right Header information `.doOnSuccess(result -> System.out.println("Response: " + result));` gave me `Response: Moved Permanently. Redirecting to /api/v0.1/countries/population/q?country=Finland`.
124
136
137
+
- All thought it was saying **redirecting**, i could not catch redirect message in network tab. Maybe it was due **ReactorNetty** needs to be configured to process these one, but for now i decided to just use th given **hint** as API query and move forward with the task :)
0 commit comments