Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
how to send property as a array to backend spring boot in angular

I have the following method with which I am trying to send to my backend some values as a list. the accepted json format is as follows:

{
value: [xyz]
}

But right now I am sending just the xyz part to my backend as a single value but I need to send it as the shown part. mine looks like this: xyz according to the payload sent to the backend in network in my console.

this is my function I am using to send these to my backend:

 setValueForTest() {
    this.personArray = this.form.controls.selectBox.value;
    this.personArraySave = []
    this.personArray.forEach((id) => {
        this.personArraySave.push(id)
        this.api.setValueForPerson({
          body: id
        
        ).subscribe(response => {
          console.log(response)
        });
      }
    });
  } 

the body and personArraySave is from type Person which only has id: Array as attribute

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Thanks for everyone who helped, the problem is fixed I just instanced an Element of the Object I am sending. Then I could work with the array element inside that model and push my values inside it.

about 4 years ago · Juan Pablo Isaza Report

0

I imagine api.setValueForPerson is a service that sends the data, if yes, maybe you can send the data something like this

setValueForPerson(person:Person):Observable<any>{
   return this.httpCLient.post<any>(yourURL, {value:person});
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!