Error : HTTP Request: Invalid URI: The Uri string is too long

When I try to download the image using the url in HTTP request, getting this error,

HTTP Request: Invalid URI: The Uri string is too long.

Please help

Try using the assign activity to assign the long string to a variable and then use the variable in the request.

When I print the string in a texfile, I can see the complete string… So I think there is no issues in the string variable, it can hold the complete text

Just so I understand - you are passing the URI into Http request using a variable?

Yes I am doing that only

Kindly check manually the URL is correct and able to open the image?


Yes opening

The same http request is working when I pass a small test url , but since the url is too long(base64), it is not working…

Any solution to overcome this

hmm - what about something like this URL Shortner - RPA Component | UiPath Marketplace

I dont think I can implement this in my process

Yeah was just a guess, looking on google, they say to try to use the POST method Invalid URI: The Uri string is too long. HttpClient

1 Like

@Sweety_Girl I’m not familiar with fixing this error, but you may try some blockcode as a workaround, rather than using the http request activity. It’s possible you can implement the uri string fixes using scripting
you can see if anything here helps: Search results for ' http request' - UiPath Community Forum

I think ClaytonM maybe right, on this site one guy is serializing to JSON to send the request.

@ClaytonM and @roy_r

Thank you so much for the your time in helping me.

This solution helped to solve this

Note: We need to remove the “data:image/jpeg;base64,” text from the url and pass to this code

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.