(Python) Can't send HTTP requests properly within railway
I'm unable to properly send out HTTP requests using the aiohttp module. It works completely fine on my local PC, but is not working on railway. For some reason when I send my request through railway, it adds a "%27" at the end of the param It's the exact same code and I'm pushing it through GH to stay in sync. I've also ensured that all requirements were installed to the latest version, and double checking using the --force flag. Python version was set to 3.11 aswell. This makes 0 sense
The code itself:
11 Replies
Project ID:
bc2620b0-2975-478d-8dbb-5f726c4e3748
%27 is ', and the closing ' is missing in URL(), hm
To me, it just looks like Discord incorrectly parsed the closing
'
as part of the URL and performed URL encoding on it. I think the issue lies elsewhere. Error message seems to suggest that the response is an HTML response instead of JSON one, and yet when I try to visit https://nekobot.xyz/api/image?type=4k%27
I get a JSON response instead of HTML.But aiohttp is performing the request, not Discord, I'm just sending the resulting image url inside the message key as the embed image url, but it's not even passing through the .json() parsing part
No, no. I mean when Discord is displaying that message, it's parsing the URL before it's displaying it. During that process, it incorrectly assumes the
'
is part of the URL.But then why does it work perfectly fine on my pc
Could you perhaps display the raw body response? Maybe it'll tell you the reason why
Sure lemme deploy rq
It seems like the API endpoint is blocking railway
Solution
Seems like Cloudflare is blocking the request
Well that's about it then ig, thx for the help