Skip to content

Commit 30e1b55

Browse files
committed
Pass data via POST
1 parent 810f502 commit 30e1b55

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"xp-framework/command": "^12.0",
1010
"xp-framework/networking": "^10.4",
1111
"xp-forge/marshalling": "^2.4",
12-
"xp-forge/web": "^4.0",
12+
"xp-forge/web": "dev-feature/websockets as 4.6.0",
1313
"xp-forge/web-auth": "^5.0",
1414
"xp-forge/frontend": "^6.4",
1515
"xp-forge/rest-api": "^4.0",

src/main/php/de/thekid/dialog/OpenMeteo.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* @see https://github.com/open-meteo/open-meteo
1111
*/
1212
class OpenMeteo {
13+
private const URLENCODED= 'application/x-www-form-urlencoded';
1314
private $base;
1415
private $auth= [];
1516
private $endpoints= [];
@@ -36,7 +37,8 @@ public function lookup(string|float $lat, string|float $lon, Date $start, ?Date
3637
'daily' => ['sunrise', 'sunset'],
3738
'hourly' => ['weather_code', 'apparent_temperature'],
3839
];
39-
return $this->endpoint('archive-api')->resource('archive')->get($params)->match([
40+
41+
return $this->endpoint('archive-api')->resource('archive')->post($params, self::URLENCODED)->match([
4042
200 => fn($r) => $r->value(),
4143
400 => fn($r) => throw new IllegalArgumentException($r->content()),
4244
]);

0 commit comments

Comments
 (0)