How to use the popsicle.form function in popsicle

To help you get started, we’ve selected a few popsicle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LearningLocker / learninglocker / ui / src / utils / LLApiClient.js View on Github external
uploadLogo = (file, id) => {
    const logoForm = form({
      logo: file
    });
    return post({
      url: formatUrl(routes.UPLOADLOGO),
      headers: {
        Authorization: `Bearer ${this.getToken()}`,
        ContentType: 'multipart/form-data; boundary=,',
        Accept: 'image/jpg, image/png,image/*;q=0.8,*/*;q=0.5'
      },
      body: logoForm,
      query: {
        data: id
      }
    });
  }
github LearningLocker / learninglocker / ui / src / utils / LLApiClient.js View on Github external
personasUpload = ({
    id,
    file
  }) => {
    const personaForm = form({
      id,
      file: file.handle
    });
    return post({
      url: formatUrl(routes.UPLOADPERSONAS),
      headers: {
        Authorization: `Bearer ${this.getToken()}`,
        ContentType: 'multipart/form-data; boundary=,',
        Accept: 'text/csv'
      },
      body: personaForm
    });
  };