Come posso ricevere i dati dalla richiesta POST nel mio controller? Non uso il ramoscello.Symfony2.8. Come ottenere i dati dalla richiesta post
public function newAction(Request $request)
{
//when I use
$content = $request->getContent();
// as result I see "string" with need field and value. It's not json
// array
// value like
/*
string '------WebKitFormBoundaryI12ukQBs3HdmPjvh
Content-Disposition: form-data; name="title"
"valuefortitle"
------WebKitFormBoundaryI12ukQBs3HdmPjvh
Content-Disposition: form-data; name="name"
"supername"
------WebKitFormBoundaryI12ukQBs3HdmPjvh--
' (length=253)
*/
}
O come posso serializzare i dati (file) sul post di opporsi o array
mando richiesta utilizzando Postino con header "Content-Type: application/json".
E puoi mostrarmi come salvare il file (immagine)?
Come risultato vedo "null". – A6Brgeuka
Puoi mostrare il tuo modulo html 'View'? –
puoi rispondere alla mia domanda e Imanali sto affrontando un problema simile qui è la mia domanda https://stackoverflow.com/q/44352796/1395965 – numerah