dongzhu3548 2019-05-15 07:38 采纳率: 0%
浏览 332

如何使用secretkey创建自定义http标头?

I want to create a custom header with secretkey as key, anyone can show me how to do this? I use the phalcon php framework.

public function onConstruct()
{
    header("Access-Control-Allow-Headers: Authorization, Content-Type");
    header("Access-Control-Allow-Origin: *");
    header("content-type: application/json; charset=utf-8");
    ?
}

I want to get api like this image on postman. enter image description here

  • 写回答

1条回答 默认 最新

  • douyan6548 2019-05-15 18:52
    关注

    use:

    header('HeaderName: HeaderValue');
    

    or with phalcon in your controller:

    $this->response->setHeader('HeaderName', 'HeaderValue');
    
    评论

报告相同问题?