http requests in version 7.4 +

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
justcolorado
Regular
Posts: 47
Joined: Sun Feb 07, 2016 9:32 pm
Completed: Experiment Gone Rogue, Caravan Of Saints, HeartBaked, Hipster Axe
Projects: Iragon
Organization: Repulse.com
Github: coloradostark
Location: Plovdiv
Contact:

http requests in version 7.4 +

#1 Post by justcolorado » Sun Dec 12, 2021 9:12 am

As a developer, I would like to make an HTTP request from ren'py to my server, so that I can use the reply for an in-game feature.

I used this repo :D https://github.com/renpytom/renpy-requests and it works fine on v7.3.5, but not on releases after.

I am OK with using v7.3.5 but there are some great new features in 7.4 series that I would also like to use.
Is there a new way to import requests, or a compatible substitute library for http requests I can use?

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: http requests in version 7.4 +

#2 Post by Ocelot » Sun Dec 12, 2021 10:24 am

That is probavbly because requests are already bundled with RenPy starting from 7.4.0.
< < insert Rick Cook quote here > >

User avatar
justcolorado
Regular
Posts: 47
Joined: Sun Feb 07, 2016 9:32 pm
Completed: Experiment Gone Rogue, Caravan Of Saints, HeartBaked, Hipster Axe
Projects: Iragon
Organization: Repulse.com
Github: coloradostark
Location: Plovdiv
Contact:

Re: http requests in version 7.4 +

#3 Post by justcolorado » Sun Dec 12, 2021 3:12 pm

Ocelot wrote:
Sun Dec 12, 2021 10:24 am
That is probavbly because requests are already bundled with RenPy starting from 7.4.0.
Thanks! that is great news. I migrated my project to the latest, imported requests without adding any packages in my /game/ directory. And now everything works fine.

In the old repo it said "It supports http and https, with a huge caveat - the https support is not validated, which means that the request - and any passwords it contains - can be read by someone trying to intercept the connection."

Do you know if this issue still exists in the latest version?

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: http requests in version 7.4 +

#4 Post by PyTom » Thu Dec 16, 2021 1:42 pm

The new version fixes that, so the requests that are made should be validated.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot]