@Override
        public void doPost(HttpServletRequest request, HttpServletResponse response)
                throws IOException {
            List<Event> events = Collections.emptyList(); // create empty list
            try {
                events = handler.getEvents(request, response);
            } catch (HTTPBadRequestException ex) {
                LOG.warn("Received bad request from client. ", ex);
                sourceCounter.incrementEventReadFail();
                response.sendError(HttpServletResponse.SC_BAD_REQUEST,
                        "Bad request from client. ");
                return;
            } catch (Exception ex) {
                LOG.warn("Deserializer threw unexpected exception. ", ex);
                sourceCounter.incrementEventReadFail();
                response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                        "Deserializer threw unexpected exception. ");
                return;
            }
            sourceCounter.incrementAppendBatchReceivedCount();
            try {
                if (events != null) {
                    sourceCounter.addToEventReceivedCount(events.size());
                    getChannelProcessor().processEventBatch(events);
                }
            } catch (ChannelException ex) {
                LOG.warn("Error appending event to channel. "
                        + "Channel might be full. Consider increasing the channel "
                        + "capacity or make sure the sinks perform faster.", ex);
                sourceCounter.incrementChannelWriteFail();
                response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE,
                        "Error appending event to channel. Channel might be full.");
                return;
            } catch (Exception ex) {
                LOG.warn("Unexpected error appending event to channel. ", ex);
                sourceCounter.incrementGenericProcessingFail();
                response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                        "Unexpected error while appending event to channel. ");
                return;
            }
            response.setCharacterEncoding(request.getCharacterEncoding());
            response.setStatus(HttpServletResponse.SC_OK);
            response.flushBuffer();
            sourceCounter.incrementAppendBatchAcceptedCount();
            if (events != null) {
                sourceCounter.addToEventAcceptedCount(events.size());
            }
        }
doPost

@param request
@param response
@throws IOException
inlong-sdk/sdk-common/src/main/java/org/apache/inlong/sdk/commons/admin/AdminHttpSource.java