• Developer New

    Friday, March 24, 2017

    how to use Responses in laravel

    return Response::make($contents);
    return Response::make($contents, 200);
    return Response::json(['key' => 'value']);
    return Response::json(['key' => 'value'])
        ->setCallback(Input::get('callback'));
    return Response::download($filepath);
    return Response::download($filepath, $filename, $headers);
    // Create a response and modify a header value$response = Response::make($contents, 200);
    $response->header('Content-Type', 'application/json');
    return $response;
    // Attach a cookie to a responsereturn Response::make($content)
        ->withCookie(Cookie::make('key', 'value'));

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel