Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.php > #4153
| From | Ralph Stahl <post@rstahl.de> |
|---|---|
| Newsgroups | de.comp.lang.php |
| Subject | Re: mit cURL json-Daten an PHP-Script schicken |
| Date | 2017-07-02 16:18 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <ojav41$fl$1@dont-email.me> (permalink) |
| References | <oj4vnm$col$1@dont-email.me> <3t59560f76i69fn3e8%sfroehli@Froehlich.Priv.at> <oj5do3$pd9$1@dont-email.me> <5t5956542bi6adcn3e8%sfroehli@Froehlich.Priv.at> |
Stefan Froehlich schrieb:
> On Fri, 30 Jun 2017 13:51:01 Ralph Stahl wrote:
>> Stefan Froehlich schrieb:
>>> JSON sieht ganz anders aus, und da es $_JSON in PHP nicht gibt,
>>> musst Du etwas in der Form von:
>>>
>>> #v+
>>> <?php var_dump(json_decode(file_get_contents("php://input"))); ?>
>>> #v-
>>>
>>> machen.
>
>> [...] Warum wird dann in allen möglichen Quellen (Foren, Beispielen)
>> einschließlich der Doku zu curl der Parameter
>>
>> curl -H "Content-Type: text/json" ...
>>
>> als erforderlich bezeichnet?
>
> Weil's korrekt ist: Du schickst ja nun einmal nicht HTML sondern JSON
> über die Leitung.
>
> Das ist zwar egal, wenn am anderen Ende jemand php://input verwendet,
> aber es *könnte* dort auch abhängig vom Content-Type verarbeitet werden.
>
> Servus,
> Stefan
>
Danke Stefan! Alles verstanden :-).
Ralph
Back to de.comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread
mit cURL json-Daten an PHP-Script schicken Ralph Stahl <post@rstahl.de> - 2017-06-30 09:51 +0200
Re: mit cURL json-Daten an PHP-Script schicken Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2017-06-30 08:58 +0000
Re: mit cURL json-Daten an PHP-Script schicken Ralph Stahl <post@rstahl.de> - 2017-06-30 13:51 +0200
Re: mit cURL json-Daten an PHP-Script schicken Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2017-06-30 13:42 +0000
Re: mit cURL json-Daten an PHP-Script schicken Ralph Stahl <post@rstahl.de> - 2017-07-02 16:18 +0200
csiph-web