package alx;

import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;

@Path("/student")
public class StudentEndpoint {

    @GET
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN})
    public Student getStudent() {
        return new Student("John", "Doe");
    }

    @POST
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Produces("text/plain;charset=UTF-8")
    public String postStudent(Student student) {
        return student.toString();
    }

}
