Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » How do I make a POST request to Scratch servers?
- FriskVRYT
-
Scratcher
18 posts
How do I make a POST request to Scratch servers?
Trying to learn how to do this type of stuff and I want to know how to make a POST request to follow a user's account.
- Penthusiast
-
Scratcher
56 posts
How do I make a POST request to Scratch servers?
Trying to learn how to do this type of stuff and I want to know how to make a POST request to follow a user's account.
Yeah so the route for this is https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAME
In this case, replace the target with the person you're trying to follow, and yourname with your username. You will need to send a scratchcsrftoken along with that request to authenticate it's you.
- gem1001
-
Scratcher
1000+ posts
How do I make a POST request to Scratch servers?
Yeah so the route for this is https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAMEThat would make a GET request, not a POST request.
In this case, replace the target with the person you're trying to follow, and yourname with your username. You will need to send a scratchcsrftoken along with that request to authenticate it's you.
There are a few ways to make a POST request; a simple method is to use JavaScript's window.fetch() in the browser console:
fetch('put whatever URL inside these quotes', {'method': 'POST'});
Last edited by gem1001 (May 12, 2026 17:21:59)
- Penthusiast
-
Scratcher
56 posts
How do I make a POST request to Scratch servers?
Yeah so the route for this is https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAMEThat would make a GET request, not a POST request.
In this case, replace the target with the person you're trying to follow, and yourname with your username. You will need to send a scratchcsrftoken along with that request to authenticate it's you.
There are a few ways to make a POST request; a simple method is to use JavaScript's window.fetch() in the browser console:fetch('put whatever URL inside these quotes', {'method': 'POST'});
I was just giving the url, not the necessary code to do it. You can also do it via a terminal command such as
curl -X POST https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAME -H "Referer: https://scratch.mit.edu/" -H "User-Agent: Mozilla/5.0"
but again you will need to provide a csrftoken to authenticate.
- FriskVRYT
-
Scratcher
18 posts
How do I make a POST request to Scratch servers?
I have my crsf token saved somewhere i think, how do i provide it to the server?Yeah so the route for this is https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAMEThat would make a GET request, not a POST request.
In this case, replace the target with the person you're trying to follow, and yourname with your username. You will need to send a scratchcsrftoken along with that request to authenticate it's you.
There are a few ways to make a POST request; a simple method is to use JavaScript's window.fetch() in the browser console:fetch('put whatever URL inside these quotes', {'method': 'POST'});
I was just giving the url, not the necessary code to do it. You can also do it via a terminal command such ascurl -X POST https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAME -H "Referer: https://scratch.mit.edu/" -H "User-Agent: Mozilla/5.0"
but again you will need to provide a csrftoken to authenticate.
- Penthusiast
-
Scratcher
56 posts
How do I make a POST request to Scratch servers?
I have my crsf token saved somewhere i think, how do i provide it to the server?Yeah so the route for this is https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAMEThat would make a GET request, not a POST request.
In this case, replace the target with the person you're trying to follow, and yourname with your username. You will need to send a scratchcsrftoken along with that request to authenticate it's you.
There are a few ways to make a POST request; a simple method is to use JavaScript's window.fetch() in the browser console:fetch('put whatever URL inside these quotes', {'method': 'POST'});
I was just giving the url, not the necessary code to do it. You can also do it via a terminal command such ascurl -X POST https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAME -H "Referer: https://scratch.mit.edu/" -H "User-Agent: Mozilla/5.0"
but again you will need to provide a csrftoken to authenticate.
Try something like
const request = await fetch('https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAME', { method: "POST", headers: { "Referer": "https://scratch.mit.edu/", "User-Agent": "Mozilla/5.0", "X-CSRFToken": TOKEN HERE } });
- Penthusiast
-
Scratcher
56 posts
How do I make a POST request to Scratch servers?
I have my crsf token saved somewhere i think, how do i provide it to the server?Yeah so the route for this is https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAMEThat would make a GET request, not a POST request.
In this case, replace the target with the person you're trying to follow, and yourname with your username. You will need to send a scratchcsrftoken along with that request to authenticate it's you.
There are a few ways to make a POST request; a simple method is to use JavaScript's window.fetch() in the browser console:fetch('put whatever URL inside these quotes', {'method': 'POST'});
I was just giving the url, not the necessary code to do it. You can also do it via a terminal command such ascurl -X POST https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAME -H "Referer: https://scratch.mit.edu/" -H "User-Agent: Mozilla/5.0"
but again you will need to provide a csrftoken to authenticate.
Try something likeconst request = await fetch('https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAME', { method: "POST", headers: { "Referer": "https://scratch.mit.edu/", "User-Agent": "Mozilla/5.0", "X-CSRFToken": TOKEN HERE } });
Actually I'm looking at a real request and it's a bit more then that. It's sending the cookies as well.
- FriskVRYT
-
Scratcher
18 posts
How do I make a POST request to Scratch servers?
This can be executed via browser console correct?I have my crsf token saved somewhere i think, how do i provide it to the server?Yeah so the route for this is https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAMEThat would make a GET request, not a POST request.
In this case, replace the target with the person you're trying to follow, and yourname with your username. You will need to send a scratchcsrftoken along with that request to authenticate it's you.
There are a few ways to make a POST request; a simple method is to use JavaScript's window.fetch() in the browser console:fetch('put whatever URL inside these quotes', {'method': 'POST'});
I was just giving the url, not the necessary code to do it. You can also do it via a terminal command such ascurl -X POST https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAME -H "Referer: https://scratch.mit.edu/" -H "User-Agent: Mozilla/5.0"
but again you will need to provide a csrftoken to authenticate.
Try something likeconst request = await fetch('https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAME', { method: "POST", headers: { "Referer": "https://scratch.mit.edu/", "User-Agent": "Mozilla/5.0", "X-CSRFToken": TOKEN HERE } });
- Penthusiast
-
Scratcher
56 posts
How do I make a POST request to Scratch servers?
This can be executed via browser console correct?I have my crsf token saved somewhere i think, how do i provide it to the server?Yeah so the route for this is https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAMEThat would make a GET request, not a POST request.
In this case, replace the target with the person you're trying to follow, and yourname with your username. You will need to send a scratchcsrftoken along with that request to authenticate it's you.
There are a few ways to make a POST request; a simple method is to use JavaScript's window.fetch() in the browser console:fetch('put whatever URL inside these quotes', {'method': 'POST'});
I was just giving the url, not the necessary code to do it. You can also do it via a terminal command such ascurl -X POST https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAME -H "Referer: https://scratch.mit.edu/" -H "User-Agent: Mozilla/5.0"
but again you will need to provide a csrftoken to authenticate.
Try something likeconst request = await fetch('https://scratch.mit.edu/site-api/users/followers/TARGET/add/?usernames=YOURNAME', { method: "POST", headers: { "Referer": "https://scratch.mit.edu/", "User-Agent": "Mozilla/5.0", "X-CSRFToken": TOKEN HERE } });
Yes it's just javascript, but from my tests you need to send the cookies as well (session token and csrf token, etc)
- Discussion Forums
- » Advanced Topics
-
» How do I make a POST request to Scratch servers?