# Shopware 4.2.1 REST API mit FastCGI liefert 302 anstatt JSON

**URL:** <https://forum.shopware.com/t/shopware-4-2-1-rest-api-mit-fastcgi-liefert-302-anstatt-json/19139>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [18. März 2014 um 10:34 UTC](https://forum.shopware.com/t/shopware-4-2-1-rest-api-mit-fastcgi-liefert-302-anstatt-json/19139 "2014-03-18T10:34:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![speed4trade](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@speed4trade](https://forum.shopware.com/u/speed4trade)\
**Post date:** [18. März 2014 um 10:34 UTC](https://forum.shopware.com/t/shopware-4-2-1-rest-api-mit-fastcgi-liefert-302-anstatt-json/19139/1 "2014-03-18T10:34:57Z")

</div>

Beim Aktualisieren eines Artikels über die REST API mit dem HTTP Type „PUT“, wird neuerdings eine 302 Weiterleitung als Response zurückgegeben, anstelle des zu erwartenden JSON Strings. Ein Beispiel-Call via PHP sieht wie folgt aus: $client-\>put(‚articles/8‘, array( ‚name‘ =\> ‚Neuer Artikelname‘ )); Wird PHP als Apache Modul eingebunden, so wird der Response korrekt als JSON übergeben. Nachfolgend der Response bei Verwendung von FastCGI: HTTP/1.1 302 Found Date: Fri, 14 Mar 2014 14:27:21 GMT Server: Apache/2.2.22 (Win32) mod\_fcgid/2.3.7 X-Powered-By: PHP/5.3.21 Cache-Control: nocache, private Location: [http://xxxx/shopware\_421/api/articles/8](http://xxxx/shopware%5C_421/api/articles/8) Content-Length: 257 Keep-Alive: timeout=5, max=99 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1

302 Found # Found

The document has moved [here](http://xxxx/shopware_421/api/articles/8).

---

<div class="post-metadata">

**Author:** ![tobias.lang](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@tobias.lang](https://forum.shopware.com/u/tobias.lang)\
**Post date:** [15. April 2014 um 12:30 UTC](https://forum.shopware.com/t/shopware-4-2-1-rest-api-mit-fastcgi-liefert-302-anstatt-json/19139/2 "2014-04-15T12:30:14Z")

</div>

Exakt dieses Verhalten tritt auch bei unserem Shop (seit update 4.2.1) auf. Als Workaround habe ich die Zeile: $this-\>Response()-\>setHeader(‘Location’, $location); in der Articles.php [Funktion putAction()] (\engine\Shopware\Controllers\Api) auskommentiert. Das ist natürlich keine Lösung! Hat jemand eine Idee woran das liegen könnte das diese Zeile ein Redirect auslöst der die oben gezeigte Auswirkung hat?

---

<div class="post-metadata">

**Author:** ![kadis](https://avatars.discourse-cdn.com/v4/letter/k/c57346/32.png) [@kadis](https://forum.shopware.com/u/kadis)\
**Post date:** [16. April 2014 um 13:48 UTC](https://forum.shopware.com/t/shopware-4-2-1-rest-api-mit-fastcgi-liefert-302-anstatt-json/19139/3 "2014-04-16T13:48:26Z")

</div>

Hallo, könnte etwas mit mit der HTACCESS zutun haben. `RewriteRule .\* - [E=HTTP\_AUTHORIZATION:%{HTTP:Authorization}] ` Bitte eben in der Wiki schauen. Dort habe ich die passende Information gefunden um es am laufen zu bekommen. Beste Grüße,
