# How to validate status code that is returned in response header

If we want to validate the status code that is returned in the response header we can use the below approach.

<div class="codeSnippet" id="bkmrk-copy-var-%24response-%3D">[Copy](javascript:void(0);)<div class="codeSnippetBody" data-mc-continue="False" data-mc-line-number-start="1" data-mc-use-line-numbers="False" style="mc-code-lang: JavaScript;">```
<span style="color: #333333; font-weight: bold; ">var</span> $response = post($url, $payload );<br></br>assertEquals($response.status, <span style="color: #008080; ">200</span>);
```

 </div> </div><div id="bkmrk-" style="border-width: 1px;"><div> </div> </div><div id="bkmrk-last-updated%3A-june-0">---

Last updated: <span class="mc-variable General.NewDateTimeVariable variable">June 02, 2023</span>

If you have any feedback on this topic, please contact us at <documentation@appvance.ai>

</div>