# Problem for to implement request lib

**URL:** <https://forum.robotframework.org/t/problem-for-to-implement-request-lib/1806>\
**Category:** RequestsLibrary\
**Created:** [20 May 2021 14:11 UTC](https://forum.robotframework.org/t/problem-for-to-implement-request-lib/1806 "2021-05-20T14:11:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![VictorOliveira](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/victoroliveira/32/799_2.png) [@VictorOliveira](https://forum.robotframework.org/u/VictorOliveira)\
**Post date:** [20 May 2021 14:11 UTC](https://forum.robotframework.org/t/problem-for-to-implement-request-lib/1806/1 "2021-05-20T14:11:08Z")

</div>

Hi guys,

I allways work with RESTinstance lib, but now a need to make a request with x-www-form-urlencoded, and i saw that RESTinstance don’t work with this.

Then I migrated for request library, but I try here to do a simple POST with json, but this returns me 500, but on the same time in RESTinstance or with Postman the request return 200. I don’t know what I do wrong.

${Dict} Create Dictionary TargetBUS=Authentication TargetMethod=GenerateSecret Parameters=[{ “Name”: “param”, “Value”: { “UserId”: “${Client\_Id}”, “CategoryID”: 9 }, “FullNameParameterType”: "BUS.Authentication.TokenTime.GenerateSecretParameterTokenTime, BUS.Authentication " }]

${resp}= POST On Session jsonplaceholder /api json=${Dict}

I don’t know if I create dictionary correct.

Error: HTTPError: 500 Server Error: Internal Server Error for url: xxxxxxxxxxxxxxxxxxxxxx

---

<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:** [21 May 2021 22:03 UTC](https://forum.robotframework.org/t/problem-for-to-implement-request-lib/1806/2 "2021-05-21T22:03:36Z")

</div>

Hi Victor,

Based on the documentation the first thing I would suggest you try is changing:  
`${Dict} Create Dictionary`  
to  
`&{Dict} Create Dictionary`

Note the ‘&’ before ‘{Dict}’

> **[MarketSquare/robotframework-requests - 🤖 More examples](https://github.com/MarketSquare/robotframework-requests#-more-examples)**
>
> Robot Framework keyword library wrapper for requests

[http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#dictionary-variable-syntax](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#dictionary-variable-syntax)

Hopefully that solves your issue,

Dave.

---

<div class="post-metadata">

**Author:** ![VictorOliveira](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/victoroliveira/32/799_2.png) [@VictorOliveira](https://forum.robotframework.org/u/VictorOliveira)\
**Post date:** [25 May 2021 13:15 UTC](https://forum.robotframework.org/t/problem-for-to-implement-request-lib/1806/3 "2021-05-25T13:15:13Z")

</div>

Tks damies13, but it’s still giving 500 error, I try to inplement with this ‘&’ too.

---

<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:** [26 May 2021 02:22 UTC](https://forum.robotframework.org/t/problem-for-to-implement-request-lib/1806/4 "2021-05-26T02:22:06Z")

</div>

Another thing you could try is changing `json=${Dict}` to `data=${Dict}`

I remember seeing a post in the forum where that solved the issue for someone else.

Dave.

---

<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:** [26 May 2021 02:25 UTC](https://forum.robotframework.org/t/problem-for-to-implement-request-lib/1806/5 "2021-05-26T02:25:01Z")

</div>

Also if you can give the body of the 500 error, sometimes there is a clue in there.

Dave.
