Answers.Body: <p>See <a href="https://stackoverflow.com/a/12018482/684">here</a> for various methods of setting the response code depending on what version of PHP and which PHP module you're running.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-27T19:35:06.203Z
Answers.LastActivityDate: 2015-02-27T19:35:06.203Z
Answers.LastEditDate: 2017-05-23T12:38:53.957Z
Answers.UserDisplayName: Brad Bell
Body: <p>I’ve tried <code>HeaderHelper::setHeader(array('code' =&gt; 200))</code> without success.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-02-27T18:21:59.597Z
Comments.Text: Can you give a little more context/code examples about what you're trying to do?  Craft will do some automatic header response code setting depending on the type of request it is.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-02-27T19:20:11.747Z
Comments.Text: I was trying to set it as a response to a web hook. 200 for a successful function, or appropriate respone if something went wrong.
Comments.UserDisplayName: James
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-03-06T10:04:53.350Z
Comments.Text: This is maybe more appropriate: http://craftcms.stackexchange.com/questions/478/render-generic-message-error-template-from-plugin
Comments.UserDisplayName: James
Tags: <plugin-development><json>
Title: How to set a response 200 from a plugin?
ThreadText: # How to set a response 200 from a plugin?
  
  (Asked by: username_0 on 2015-02-27)
  
  I’ve tried `HeaderHelper::setHeader(array('code' => 200))` without success.
  
  **Tags:** plugin-development, json
  
  > **Comments:**
  > **username_1**: Can you give a little more context/code examples about what you're trying to do?  Craft will do some automatic header response code setting depending on the type of request it is.  
  > **username_0**: I was trying to set it as a response to a web hook. 200 for a successful function, or appropriate respone if something went wrong.  
  > **username_0**: This is maybe more appropriate: http://craftcms.stackexchange.com/questions/478/render-generic-message-error-template-from-plugin  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-02-27. Score: 3 | Accepted answer
  
  See [here](https://stackoverflow.com/a/12018482/684) for various methods of setting the response code depending on what version of PHP and which PHP module you're running.
  
  
  ---
  
  