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
- We are making `application.yml` for this microservices.
71
71
- If this microservice would ran in different environment.
72
72
73
73
- Domain classes represents classes inside business logic.
74
-
- DTO classes represents REST API
74
+
- DTO classes represents REST API.
75
75
76
76
## How to run the application.
77
77
@@ -88,23 +88,23 @@ docker compose up
88
88
...
89
89
90
90
91
-
<details>
91
+
<detailsstyle="visibility:hidden">
92
92
<summaryid="problem1">Weird Feature 1.</summary>
93
93
94
94
95
95
- 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
96
97
-
- Tool to catch the request were **Request Catcher**, it helped me to distinguish if there were some error in the request what **Netty** was making. URL of catcher `https://test.requestcatcher.com/`. **POST** didn't work for some reason and could not get any stream of data back from **Web Client** using DTO classes.
98
-
- I Noticed the only difference mainly was headers. Left picture from **ReactorNetty** request and right form**PostMan**, which worked. I tried to change **User-Agent** to `User-Agent: PostmanRuntime/7.42.0` in **ReactorNetty** so it would work, but my luck failed.
97
+
- Tool to catch the request were **Request Catcher**, it helped me to distinguish if there were some error in the request what **ReactorNetty** was making. URL of catcher `https://test.requestcatcher.com/`. **POST** didn't work for some reason and could not get any stream of data back from **Web Client** using DTO classes.
98
+
- I Noticed the only difference mainly was headers. Left picture from **ReactorNetty** request and right from**PostMan**, which worked. I tried to change **User-Agent** to `User-Agent: PostmanRuntime/7.42.0` in **ReactorNetty** so it would work, but my luck failed.
- Due to the inspections how PostMan had it working with this API. It had following settings `Accept: */*`.
106
106
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 give JSON), gave me positive surprise.
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.
108
108
109
109
110
110
```
@@ -124,37 +124,3 @@ docker compose up
124
124
125
125
126
126
</details>
127
-
128
-
<!--
129
-
# Weird Feature 1.
130
-
131
-
- 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**.
132
-
133
-
- Tool to catch the request were **Request Catcher**, it helped me to distinguish if there were some error in the request what **Netty** was making. URL of catcher `https://test.requestcatcher.com/`. **POST** didn't work for some reason and could not get any stream of data back from **Web Client** using DTO classes.
134
-
- I Noticed the only difference mainly was headers. Left picture from **ReactorNetty** request and right form **PostMan**, which worked. I tried to change **User-Agent** to `User-Agent: PostmanRuntime/7.42.0` in **ReactorNetty*' so it would work, but my luck failed.
- Due to the inspections how PostMan had it working with this API. It had following settings `Accept: */*`.
142
-
143
-
- Luckily returning `Mono<String>` from **POST** function and changing NettyReactor headers to `"Accept", MediaType.ALL_VALUE` from `"Accept", MediaType.APPLICATION_JSON_VALUE`(since API give JSON), gave me positive surprise.
144
-
145
-
146
-
```
147
-
@Bean
148
-
public WebClient webClient(WebClient.Builder builder) {
149
-
return builder.defaultHeader(
150
-
"Accept", MediaType.ALL_VALUE)
151
-
.build();
152
-
}
153
-
```
154
-
155
-
- 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`.
0 commit comments