Error when trying to post to scratch.mit.edu API

I try to post but it gives me an error

Error message

 

 

Forbidden (403)

CSRF verification failed. Request aborted.

You are seeing this message because this HTTPS site requires a 'Referer header' to be sent by your Web browser, but none was sent. This header is required for security reasons, to ensure that your browser is not being hijacked by third parties.

If you have configured your browser to disable 'Referer' headers, please re-enable them, at least for this site, or for HTTPS connections, or for 'same-origin' requests.

More information is available with DEBUG=True.

what do I do to fix this?

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

there isn't much...

it seems to be, you are trying to automatically login to Scratch?
is there an API available? any link to its documentation?

Taifun

I figured out the issue! But I have a new issue I can't have the "" on there from the string, how would I remove those?

also, there is no official documentation.

here is the fixed code:

your request headers look strange...

which double quotes are you taking about?

Taifun

I don't think it wants a string rather it wants a list in javascript format, I think although I do beleave the request headers are correct I am basing my programs login on this programs way of logging into scratch if I have some errors let me know :smiley:

Show us the data you want to clean.
If it is JSON format you can use Web1.JSONDecode

it needs to be a javascript list? I think? so the "{Username,password}" needs to be posted as {username,password}

scratch is starting to agree with me :smiley: although I think the final error is the body not working as I got the headers fixed :smiley:

nm I have no idea what broke anymore, again

nm the header is ok

I figured it out! thank you so much for your help!

Show us?
This looks interesting.

sure :smiley:

oops I forgot to resond to you, just making sure you see this message :smiley:

But what comes back in the responseContent after all that?