# 'Get Request' is deprecated.... and exceptions

**URL:** <https://forum.robotframework.org/t/get-request-is-deprecated-and-exceptions/6911>\
**Category:** Libraries\
**Created:** [27 February 2024 12:37 UTC](https://forum.robotframework.org/t/get-request-is-deprecated-and-exceptions/6911 "2024-02-27T12:37:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![teknopaul](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@teknopaul](https://forum.robotframework.org/u/teknopaul)\
**Post date:** [27 February 2024 12:37 UTC](https://forum.robotframework.org/t/get-request-is-deprecated-and-exceptions/6911/1 "2024-02-27T12:37:31Z")

</div>

Get Request’ is deprecated. Please use `GET On Session`

When attempting to change to the new GET On Session all our negative tests fail. We have various test that check responses are _not_ 200.

How can we port these tests because GET On Session throws exceptions.

---

<div class="post-metadata">

**Author:** ![\_daryl](https://avatars.discourse-cdn.com/v4/letter/_/45deac/32.png) [@\_daryl](https://forum.robotframework.org/u/_daryl)\
**Post date:** [27 February 2024 16:07 UTC](https://forum.robotframework.org/t/get-request-is-deprecated-and-exceptions/6911/2 "2024-02-27T16:07:01Z")

</div>

Sounds like you’d just need to pass the argument `expected_status`

> By default this keyword fails if a status code with error values is returned in the response, this behavior can be modified using the `expected_status` and `msg` parameters, read more about it in [Status Should Be](https://marketsquare.github.io/robotframework-requests/doc/RequestsLibrary.html#Status%20Should%20Be) keyword documentation. In order to disable this implicit assert mechanism you can pass as `expected_status` the values `any` or `anything` .

[link to documentation \>](https://marketsquare.github.io/robotframework-requests/doc/RequestsLibrary.html#GET%20On%20Session)

---

<div class="post-metadata">

**Author:** ![teknopaul](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@teknopaul](https://forum.robotframework.org/u/teknopaul)\
**Post date:** [29 February 2024 14:02 UTC](https://forum.robotframework.org/t/get-request-is-deprecated-and-exceptions/6911/3 "2024-02-29T14:02:00Z")

</div>

> [@\_daryl](#):
>
> `expected_status`

Cool thanks, I’ll give that a try, I “just” need to update 1000s of tests 🙂

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [29 February 2024 14:50 UTC](https://forum.robotframework.org/t/get-request-is-deprecated-and-exceptions/6911/4 "2024-02-29T14:50:09Z")

</div>

I know the pain (I had quite a few tests to update myself), but that change to `expected_status` was introduced in 2021, so I guess guess you haven’t run theses tests for quite a while.

FYI this functionality changed with v0.8.0 of requests library, I guess if you need to run the tests urgently you could install an older version of requests library, run your tests, let the project progress, and let that buy you some time to maintain the test cases.

Dave.
