abdfnx/resto

support `Resto` file

abdfnx opened this issue · 4 comments

it's an great idea to support resto file, but why ?

  1. Send requests from files easily
  2. Save time
  3. a New Feature

so I choose yaml as the file format and the file name is .resto.yml

example

method: "POST"
url: "https://api.spacex.land/graphql"
contentType: "application/graphql"
openBodyEditor: true
# if `openBodyEditor` is false
body: |
   query {
     launchesPast(limit: 2) {
       mission_name
       launch_date_local
       launch_site {
         site_name_long
       }

       links {
         article_link
         video_link
       }

       rocket {
         rocket_name
         first_stage {
           cores {
             flight
             core {
               reuse_count
               status
             }
           }
         }

         second_stage {
           payloads {
             payload_type
             payload_mass_kg
             payload_mass_lbs
           }
         }
       }

       ships {
         name
         home_port
         image
       }
     }
   }
authType: "Bearer"
token: "MY_TOKEN"
# or basic auth
username: "USERNAME"
password: "P@$$w0rd"

that's it 👍

hmm, I like it, it's sounds a great idea, so let's work on it

what about create our own file? like Dockerfile or Jenkinsfile

maybe Restofile is nice

example

request {
   method "POST"
   url "https://api.spacex.land/graphql"
   contentType "application/graphql"
}

body {
   openBodyEditor "true"
   # if `openBodyEditor` prop is false or not set
   readFrom "PATH_TO_FILE"
}

auth {
   type "bearer"
   token: "MY_TOKEN"
   # or basic auth
   type "basic"
   username: "USERNAME"
   password: "P@$$w0rd"
   # to use from env variable
   password "env:MY_PASSWORD"
}

and we can add support for headers

@Timothee-Cardoso yeah it's awesome. I think Restofile is great, The decision was made **we'll support Restofile with our rolls

we did it, thanks for your work