Skip to content

Commit 760a504

Browse files
committedSep 16, 2024
updated read.me
1 parent 62807b1 commit 760a504

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed
 

‎README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,15 @@ docker compose up
8585

8686
# Maven
8787

88+
8889
...
8990

91+
<!-- Remove these when all points ready here
9092
91-
<details style="visibility:hidden">
93+
<details>
9294
<summary id="problem1">Weird Feature 1.</summary>
9395
96+
//TODO tee tähän johtopäätös https://countriesnow.space/api/v0.1/countries/population
9497
9598
- 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**.
9699
@@ -104,7 +107,7 @@ docker compose up
104107
105108
- Due to the inspections how PostMan had it working with this API. It had following settings `Accept: */*`.
106109
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.
108111
109112
110113
```
@@ -116,11 +119,24 @@ docker compose up
116119
}
117120
```
118121
122+
- With DTO class.
123+
124+
```
125+
@Data
126+
@AllArgsConstructor
127+
public class ParamClass {
128+
String country;
129+
}
130+
```
119131
- Below positive surprise. I was not crazy and seeing things.
120132
121133
<img src="positveSupriseAboutPOSTapi.PNG" alt="alt text" width="600"/>
122134
123135
- 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`.
124136
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 :)
138+
139+
<img src="noRedirectCaptured.PNG" alt="alt text" width="600"/>
125140
126141
</details>
142+
-->

‎noRedirectCaptured.PNG

57.6 KB
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.