如何接收来自API 的响应,该响应由p-fileUpload 的url 属性指定?

how to receive the response of coming from the API specified with the url attribute of p-fileUpload?

我有这个控件:

<p-fileUpload url="http://localhost:8586/upload"
              (onUpload)="onUpload($event)"
              multiple="multiple">

api在http://localhost:8586/uploadreturns{key:value}上传文件后。我如何访问 api 的回复?

在html所属的同一个组件中,编写'p-fileupload'component/library.

跟踪输出事件的方法

示例方法是 -

public onUpload(event): void {
  // access key value here. probably event.key
  const key = event.key;
}