no
This commit is contained in:
@@ -18,6 +18,7 @@ async fn api_ticket(id: web::Path<i32>) -> impl Responder {
|
|||||||
.content_type(ContentType::plaintext())
|
.content_type(ContentType::plaintext())
|
||||||
.insert_header(("Access-Control-Allow-Origin", "*"))
|
.insert_header(("Access-Control-Allow-Origin", "*"))
|
||||||
.insert_header(("content-type", "text/plain"))
|
.insert_header(("content-type", "text/plain"))
|
||||||
|
.insert_header(("content-encoded", "gzip"))
|
||||||
.body(format!(
|
.body(format!(
|
||||||
"Ticket ID: {}, Ticket Price: {}, Ticket Status: {}",
|
"Ticket ID: {}, Ticket Price: {}, Ticket Status: {}",
|
||||||
fetched_ticket_data.id, fetched_ticket_data.category, fetched_ticket_data.description
|
fetched_ticket_data.id, fetched_ticket_data.category, fetched_ticket_data.description
|
||||||
@@ -33,6 +34,7 @@ async fn api_admin(id: web::Path<i32>) -> impl Responder {
|
|||||||
.content_type(ContentType::plaintext())
|
.content_type(ContentType::plaintext())
|
||||||
.insert_header(("Access-Control-Allow-Origin", "*"))
|
.insert_header(("Access-Control-Allow-Origin", "*"))
|
||||||
.insert_header(("content-type", "text/plain"))
|
.insert_header(("content-type", "text/plain"))
|
||||||
|
.insert_header(("content-encoded", "gzip"))
|
||||||
.body(format!(
|
.body(format!(
|
||||||
"Admin ID: {}, Admin Name: {}, Admin Email: {}",
|
"Admin ID: {}, Admin Name: {}, Admin Email: {}",
|
||||||
fetched_admin_data.id, fetched_admin_data.name, fetched_admin_data.address
|
fetched_admin_data.id, fetched_admin_data.name, fetched_admin_data.address
|
||||||
@@ -47,6 +49,7 @@ async fn api_driver(id: web::Path<i32>) -> impl Responder {
|
|||||||
//headers for plain text
|
//headers for plain text
|
||||||
.insert_header(("Access-Control-Allow-Origin", "*"))
|
.insert_header(("Access-Control-Allow-Origin", "*"))
|
||||||
.insert_header(("content-type", "text/plain"))
|
.insert_header(("content-type", "text/plain"))
|
||||||
|
.insert_header(("content-encoded", "gzip"))
|
||||||
.body(format!(
|
.body(format!(
|
||||||
"Driver ID: {}, Driver Name: {}, Driver Email: {}",
|
"Driver ID: {}, Driver Name: {}, Driver Email: {}",
|
||||||
fetched_driver_data.id, fetched_driver_data.name, fetched_driver_data.address
|
fetched_driver_data.id, fetched_driver_data.name, fetched_driver_data.address
|
||||||
@@ -58,5 +61,6 @@ async fn api_test() -> impl Responder {
|
|||||||
.content_type(ContentType::plaintext())
|
.content_type(ContentType::plaintext())
|
||||||
.insert_header(("Access-Control-Allow-Origin", "*"))
|
.insert_header(("Access-Control-Allow-Origin", "*"))
|
||||||
.insert_header(("content-type", "text/plain"))
|
.insert_header(("content-type", "text/plain"))
|
||||||
|
.insert_header(("content-encoded", "gzip"))
|
||||||
.body("My balls are on fire :(")
|
.body("My balls are on fire :(")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user