Chef:Http_request做出回应

时间:2017-10-05 09:07:40

标签: http chef

我想从以下http请求中获取http响应:

http_request 'init' do
  url 'http://127.0.0.1:8200/v1/sys/init'
  message ({})
  action :put
end

感谢。

1 个答案:

答案 0 :(得分:1)

您不能这样做,资源通常没有输出值。您可以使用底层HTTP库(class My Class extends React.Component { constructor(props) { super(props); this.state = { isDesktop: window.innerHeight > 1450, }; } render() { const isDesktop = this.state.isDesktop; return ( <div> {isDesktop ? ( <div>I show on 1451px or higher</div> ) : ( <div>I show on 1450px or lower</div> )} </div> ); }} )或在您自己的代码中使用类似法拉第的东西。