Created
March 7, 2026 08:49
-
-
Save davepcallan/cb40eb5596a46351a315c8a32b5924d8 to your computer and use it in GitHub Desktop.
Http file example showing how to create random ints and use request variables to store values from one request for use in later requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @baseUrl = https://localhost:7053 | |
| @dummyInt = {{$randomInt 100000 999999}} | |
| ### Create Doctor (for appointment) | |
| # @name createDoctor | |
| POST {{baseUrl}}/doctors | |
| Content-Type: application/json | |
| { | |
| "firstName": "Emma", | |
| "lastName": "Williams", | |
| "specialty": "General Practice", | |
| "email": "emma.{{dummyInt}}@hospital.com", | |
| "licenseNumber": "GP{{dummyInt}}" | |
| } | |
| ### Create Patient (for appointment) | |
| # @name createPatient | |
| POST {{baseUrl}}/patients | |
| Content-Type: application/json | |
| { | |
| "firstName": "James", | |
| "lastName": "Taylor", | |
| "dateOfBirth": "1985-08-22", | |
| "email": "james.{{dummyInt}}@patient.com" | |
| } | |
| ### | |
| @DoctorId = {{createDoctor.response.body.$.doctorId}} | |
| @PatientId = {{createPatient.response.body.$.patientId}} | |
| ### Create Appointment | |
| # @name createAppointment | |
| POST {{baseUrl}}/appointments | |
| Content-Type: application/json | |
| { | |
| "doctorId": {{DoctorId}}, | |
| "patientId": {{PatientId}}, | |
| "appointmentDate": "2028-12-15T10:30:00", | |
| "notes": "Initial consultation" | |
| } | |
| ### | |
| @AppointmentId = {{createAppointment.response.body.$.appointmentId}} | |
| ### Get Appointment by ID | |
| GET {{baseUrl}}/appointments/{{AppointmentId}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment