opony Posted November 17, 2022 Share Posted November 17, 2022 (edited) Cześć, podczas usuwania (produktu, klienta, czegokolwiek ) otrzymuję HTTP status of 400. Get działa bez problemu. HTTP REQUEST HEADER DELETE /api/customers/3 HTTP/2 Host: www.moj-sklep.pl authorization: Basic xxxxxxxxxxxxxxxxxxxxx accept: */* HTTP RESPONSE HEADER HTTP/2 400 date: Thu, 17 Nov 2022 12:22:19 GMT content-type: text/html content-length: 577 access-control-allow-origin: * server: IdeaWebServer/5.0.0 PHP nie zwraca błędów. Gdzie szukać przyczyny ? Wersja Presty 1.6.0.14 PHP 8.1.5 Edited November 17, 2022 by opony (see edit history) Link to comment Share on other sites More sharing options...
endriu107 Posted November 17, 2022 Share Posted November 17, 2022 Masz na pewno zbyt wysoką wersję PHP ustaw 5.6 i sprawdź ponownie. Link to comment Share on other sites More sharing options...
opony Posted November 17, 2022 Author Share Posted November 17, 2022 Na wersji PHP 5.6.35 ten sam błąd Link to comment Share on other sites More sharing options...
opony Posted November 18, 2022 Author Share Posted November 18, 2022 Kiedy używam adresu www bezpośrednio z przeglądarkihttps://www.moj-sklep.pl/api/products/325/?ps_method=DELETE&output_format=JSON wszystko działa. Produkt jest usuwany. Dlaczego to samo nie działa przez PrestaShopWebservice. Prosty kod: try { $webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); $del = $webService->DELETE(array('resource' => 'products', 'id' => 325)); } catch (PrestaShopWebserviceException $ex) { echo '<br>Other error: <br />' . $ex->getMessage(); } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now