asyrjasalo / RESTinstance

Robot Framework library for RESTful JSON APIs
https://asyrjasalo.github.io/RESTinstance
GNU Lesser General Public License v3.0
203 stars 84 forks source link

How to validate specific http header from the response? #128

Closed 4nif closed 1 year ago

4nif commented 2 years ago
  1. Is it possible to validate specific header from the response?
  2. How to validate response time from the response?
asimell commented 2 years ago

Hi, sorry for the delay.

  1. Yes, you can query response headers normally. For example
    My Keyword
        Get    /api/forms/1
        ${headers}=    Output    response headers
        # Or
        String    response headers Content-Type    application/json
  2. The headers typically have a Date key, so you can just do something like this
    My Keyword
        Get    /api/forms/1
        ${date}=    Output    response headers Date
        # Validate the time using your favourite method
github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.