Ask coding questions

← Back to all posts
Change content of file with a request
JEISA (0)

Hello everyone, I was wondering if it was possible to change the content of main.py with a request (with the request coming from an outside source or within replit itself). Here's some (pseudo?)code to illustrate what I'm trying to achieve

import requests

requests.post(
    'https://replit.com/@JEISA/Filename#main.py,
     data={'content': newfilecontent}
)
Answered by Coder100 (18882) [earned 5 cycles]
View Answer
Voters
JEISA (0)
Comments
hotnewtop
Coder100 (18882)

you can't, because first:
your api proposal is super insecure... they actually did create an API for it, but it was abused, and had security vulnerabilities, so they removed it to make it better!

JEISA (0)

so they removed it to make it better!

Do you know when they are releasing it? Thanks for the answer btw

Coder100 (18882)

probably next year, from what I have heard @JEISA

JEISA (0)

@Coder100

Do you know if there is a way around this? I was thinking of sending content to it with flask but I would have to keep it alive with uptimerobot (or something similar) which is a hassle.

Coder100 (18882)

well
that would be what I would do unfortunately
maybe try the always on if you are willing to get hacker @JEISA