lundi 7 octobre 2019

How can i return with Content type in laravel?

I am trying to use Laravel application as android studio project ,

and trying to send httpsrequest from Java and how do i return a response ?

Like we use in php to return response to json as header('Content-Type: application/json'); at the header oh .php file and the message as $response["message"] = "Signin succsessfully done."; echo json_encode($response);

so in laravel i am trying to return response as return response()->json(['success'=>1]) ->header('Content-Type', 'application/json');

but it's not working

in my Java file JSONObject json = jsonParser.makeHttpRequest(url, "POST", params);

So How do i do this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire