Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Feature request: blocks to send HTTP requests

    Feedback
    feature-request
    3
    5
    408
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jeffreyrb03-gmail
      JaecadeJnight Mod Helper last edited by

      I emailed the CreatiCode about this suggestion back when there was a bug that didn’t let me make a forum account, but I’ll also put it here along with some code to make it easier.

      Blocks that allow you to send HTTP requests would be a really cool, useful, and important feature. HTTP requests are the main way to communicate between a client and a server, for example, browsers send GET HTTP requests to websites in order to display websites to you.
      I want HTTP request blocks to be added because I have a project that needs to communicate with my website and its database in order to make accounts and login and do stuff like that.
      While there does exist a block (get website as markdown(https://google.com)) that basically sends a GET request to a website and converts the returned HTML to markdown, it isn’t useful for most logical cases, and can’t send information to a website, only can get a website.

      So HTTP requests work like this: you have to send one to a URL, and it is either a POST or GET (there are others that exist but aren’t common used), and you send other stuff too like response body and response headers.
      https://reqbin.com allows you to send HTTP requests of all kinds, so when making the block, it should basically allow you to do everything that site does.
      I have made a mockup of what the block could look like (its in the Cloud section):
      29d721ed-8d02-46e3-b0e8-55aa1dde9145-image.png
      This would allow you to do what the website would do, here is basically the equivalent:
      5a08bb1f-6929-4cdc-a5ba-16ee5c82716a-image.png

      #LLJW
      <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

      info-creaticode Tyller_ 2 Replies Last reply Reply Quote 0
      • info-creaticode
        CreatiCode @jeffreyrb03-gmail last edited by

        @jeffreyrb03-gmail

        Thanks for the write-up. This feature is currently queued since it involves both front-end and back-end, and most of our users (k-12 students) may not use this feature.

        jeffreyrb03-gmail 1 Reply Last reply Reply Quote 1
        • jeffreyrb03-gmail
          JaecadeJnight Mod Helper @info-creaticode last edited by

          @info-creaticode Got it, thx!

          #LLJW
          <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

          1 Reply Last reply Reply Quote 0
          • Tyller_
            Tyller_ Best Forum Helpers @jeffreyrb03-gmail last edited by

            @jeffreyrb03-gmail I have found out how to send post requests but haven’t found how to retrieve but you could, though it is definetly a security issue because it’s running html tags (except the script tag and javascirpt in a hyperlink href don’t work, but setting all styles to initial does work and nuke the page into text)

            If you open a chat window in widgets and add a message containing html tags, they will format, so using

              <input type="text" name="data" value="Hello, Server!">
              <button type="submit">Send Request</button>
            </form>
            <iframe name="responseFrame" style="display: none;"></iframe>
            

            Works, except you’ll have to do some magic to make that show to a variable, though it’s very much a security issue still

            <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
            </div>

            jeffreyrb03-gmail 1 Reply Last reply Reply Quote 1
            • jeffreyrb03-gmail
              JaecadeJnight Mod Helper @Tyller_ last edited by

              @tyller_ cool

              #LLJW
              <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

              1 Reply Last reply Reply Quote 0
              • First post
                Last post