rpaframework icon indicating copy to clipboard operation
rpaframework copied to clipboard

RPA.HTTP difficult to use

Open orlof opened this issue 4 years ago • 1 comments

e.g. POST request with headers and basic auth requires 4 lines of code and list and dict that are both a bit clumsy to handle with RF syntax:

    &{Headers}   Create Dictionary  Content-Type=application/json
    @{Auth}      Create List  [email protected]  some_secret
    Create Session    my_session    https://robocorp.zendesk.com
    ...               headers=${Headers}  auth=${Auth}  verify=${TRUE}
    Post Request    my_session  api/v2/some.json  data=some data

orlof avatar Sep 08 '21 05:09 orlof

Another vote for improving HTTP library API. E.g. uploading files is too complicated as you typically must:

  1. Get binary file
  2. Create file dictionary
  3. Create headers dictionary
  4. Create session
  5. Make post request

With simpler api the file loading and file dictionary could be integrated into POST request keyword.

orlof avatar Mar 01 '22 08:03 orlof

tackle through examples https://robocorp.com/docs/development-guide/http/http-examples

tonnitommi avatar Apr 13 '23 10:04 tonnitommi