Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API #49

Closed
zmoon opened this issue Sep 14, 2022 · 3 comments
Closed

API #49

zmoon opened this issue Sep 14, 2022 · 3 comments

Comments

@zmoon
Copy link
Member

zmoon commented Sep 14, 2022

Is this example from the readme

curl \
  --location \
  --request POST '127.0.0.1:5000/run' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "code": "program hello\r\n  print *, 'Hello, World!'\r\nend program hello\r\n",
    "programInput": "",
    "libs" : []
}'

supposed to work with https://play.fortan-lang.org? I tried but get a response of

<html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
</body>
</html>

Wondering about linking code samples in FortranTipBrowser to this playground. I guess what would be more useful for that would be being able to pass the script in URL query parameters, as is possible with Godbolt.

@milancurcic
Copy link
Member

No, but try with https://play-api.fortan-lang.org.

After #34 is implemented, you'll need to set the Origin: play.fortran-lang.org header in the request for it to be accepted.

@zmoon
Copy link
Member Author

zmoon commented Sep 14, 2022

No, but try with https://play-api.fortan-lang.org/.

Thanks, here is the updated example for reference:

curl \
  --location \
  --request POST 'https://play-api.fortran-lang.org/run' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "code": "program hello\r\n  print *, \"Hello, World!\"\r\nend program hello\r\n",
    "programInput": "",
    "libs" : []
}'

☝️ I did have to change the quoting of "Hello, World!" for it to work for me

@milancurcic
Copy link
Member

Good catch, do you mind a quick PR to fix the snippet in the README? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants