--- URL: "/guide/core/post" LLMS_URL: "/guide/core/post/llms.txt" --- # Create `POST` *endpoint* ## Usage ```ts twoslash import { App } from 'backan' const id = 'form' const route = new App( ) const { validation, response, } = route route.add( { method : 'post', path : '/', request : { body : { content : { 'multipart/form-data' : { schema : validation .object( { foo : validation.string(), bar : validation.string(), image : validation.instanceof( File ).or( validation.string() ).openapi( { type : 'string', format : 'binary', } ), } ) .openapi( { required: [ 'foo' ] } ) } } } }, responses : { 200 : response.responseJSONSuccess( validation.object( { foo : validation.string(), bar : validation.string().nullable(), image : validation.string().nullable(), } ) ), 400 : response.responseJSONError400, 500 : response.responseJSONError500, }, tags : [ id ], }, async c => { const { foo, bar, image, } = c.req.valid( 'form' ) if ( image instanceof File ) { // save file code here } return c.json( { foo, bar, image : image instanceof File ? image.name : null, }, 200, ) }, ) export default route ```