You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: delivery_worker.rb
    path of file: ./repos/dato.rss/app/workers/webhook
    
    the code of the file until where you have to start completion: require 'net/http'

module Webhook
  class DeliveryWorker
    include Sidekiq::Worker
    sidekiq_options retry: 3, backtrace: 10


    
    def perform(endpoint_id, payload)
      endpoint = Callback.find(endpoint_id)

      response = request(endpoint.url, payload)

      case response.code
      when 410
        endpoint.destroy
      when 400..599
        raise response.to_s
      end