Skip to content

Instantly share code, notes, and snippets.

@davepcallan
Created March 7, 2026 08:49
Show Gist options
  • Select an option

  • Save davepcallan/cb40eb5596a46351a315c8a32b5924d8 to your computer and use it in GitHub Desktop.

Select an option

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
@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