def post(request)
      params = Rack::Utils::Multipart.parse_multipart(request.env)
      cookbook = JSON.parse(params['cookbook'], symbolize_names: true)
      tarball = params['tarball']

      metadata = find_metadata(tarball)

      if store.find(metadata.name, metadata.version)
        respond(401,
          {
            'error_code' => 'ALREADY_EXISTS',
            'error_messages' => ['Resource already exists'],
          }
        )
      else
        respond(create_cookbook(metadata, cookbook).to_hash)
      end
    end
def post(request)
      params = Rack::Utils::Multipart.parse_multipart(request.env)
      cookbook = JSON.parse(params['cookbook'], symbolize_names: true)
      tarball = params['tarball']

      metadata = find_metadata(tarball)

      if store.find(metadata.name, metadata.version)
        respond(401,
          {
            'error_code' => 'ALREADY_EXISTS',
            'error_messages' => ['Resource already exists'],
          }
        )
      else
        respond(create_cookbook(metadata, cookbook).to_hash)
      end
    end
POST /cookbooks