Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

supertest multipart/form-data

const res = await request(app)
  .post('/api/auth/register')
  .field('name', userData.name)
  .field('email', userData.email)
  .field('password', userData.password)
  .field('personalInformation[firstName]', personalInformation.firstName)
  .field('personalInformation[lastName]', personalInformation.lastName)
  .field('personalInformation[birtDate]', personalInformation.birtDate)
  .field('personalInformation[bornDate]', personalInformation.bornDate)
  .field('personalInformation[address]', personalInformation.address)
  .field('workExperinces[0][companyName]', workExperinces.companyName)
  .field('workExperinces[0][jobsPosition]', workExperinces.jobsPosition)
  .field('workExperinces[0][startWork]', workExperinces.startWork)
  .field('workExperinces[0][endWork]', workExperinces.endWork)
  .field('workExperinces[0][jobsDescription]', workExperinces.jobsDescription)
  .attach('photo', readPhoto)
  .attach('document', readDocument)
  .set('Content-Type', 'multipart/form-data')
Comment

PREVIOUS NEXT
Code Example
Javascript :: get function parameters count javascript 
Javascript :: wordpress javascript localization 
Javascript :: get current time jquery 
Javascript :: quasar apexchart 
Javascript :: change root color js 
Javascript :: get element innerhtml jquery 
Javascript :: jquery .click function call 
Javascript :: how to concatenate strings javascript 
Javascript :: js create array from for loop 
Javascript :: detect livewire is loading in javascript 
Javascript :: Map in Javascript in LWC 
Javascript :: moment get timezone 
Javascript :: javascript today date in epoch 
Javascript :: react-native safeareaview 
Javascript :: axios send file 
Javascript :: query string from object js 
Javascript :: divisible by 3 javascript 
Javascript :: javascript object.assign 
Javascript :: jquery declare variable 
Javascript :: node main 
Javascript :: javascript indexof with condition 
Javascript :: vuejs check object key exist 
Javascript :: delete a node in dom javascript 
Javascript :: javascript random text from array 
Javascript :: click unbind bind 
Javascript :: js array add every element of array 
Javascript :: foreach break js 
Javascript :: accessing object properties with bracket notation 
Javascript :: angular pipe percentage 
Javascript :: node js server 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =