code: func (s *containerRouter) postContainersCopy(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
  	// Deprecated since 1.8, Errors out since 1.12
  	version := httputils.VersionFromContext(ctx)
  	if versions.GreaterThanOrEqualTo(version, "1.24") {
  		w.WriteHeader(http.StatusNotFound)
  		return nil
  	}
  	if err := httputils.CheckForJSON(r); err != nil {
  		return err
  	}
  
  	cfg := types.CopyConfig{}
  	if err := json.NewDecoder(r.Body).Decode(&cfg); err != nil {
  		if err == io.EOF {
  			return errdefs.InvalidParameter(errors.New("got EOF while reading request body"))
  		}
  		return errdefs.InvalidParameter(err)
  	}
  
  	if cfg.Resource == "" {
  		return pathError{}
  	}
  
  	data, err := s.backend.ContainerCopy(vars["name"], cfg.Resource)
  	if err != nil {
  		return err
  	}
  	defer data.Close()
  
  	w.Header().Set("Content-Type", "application/x-tar")
  	_, err = io.Copy(w, data)
  	return err
  }
docs: // postContainersCopy is deprecated in favor of getContainersArchive.