Jump to content

HTTP status of 400 - PrestaShopWebservice


Recommended Posts

Cześć, podczas usuwania (produktu, klienta, czegokolwiek ) otrzymuję HTTP status of 400.
Get działa bez problemu. 

DELETE /api/customers/3 HTTP/2
Host: www.moj-sklep.pl
authorization: Basic xxxxxxxxxxxxxxxxxxxxx
accept: */*

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

PHP 8.1.5

Edited by opony (see edit history)

Share this post

Link to post
Share on other sites

Kiedy używam adresu www bezpośrednio z przeglądarki

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();


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More