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

121
Views
How to send Object data to Api in react native

this is the data i want to send to api

"postcodes": { "postcode_0": { "postcode_id": "postcode-0001" }, "postcode_1": { "postcode_id": "postcode-0002" } },

this is my code

const responsepostal = await axios.post
                (`${urldemo}postal-codes`)
            setData3(responsepostal.data.result)

const [data3, setData3] = useState([])
    const [postcodes, setPostcodess] = useState([]);


 var dataToSend = {
                postcodes: postcodes,
            };

 <Picker style={GlobalSS.picker}
                        // selectedValue={postcodes.toString()}
                        selectedValue={postcodes}
                        mode='dropdown'
                        dropdownIconRippleColor='orange'
                        dropdownIconColor='#FF8025'
                        onValueChange={(itemValue, itemIndex) =>
                            setPostcodess(itemValue)
                        }>

                        <Picker.Item color='grey'
                            label="Select Postal Code " value="" />
                        {data3.map(item => (
                            <Picker.Item label={item.text} value={item.id} />
                        ))}
                    </Picker>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

for Sending the data in Object

let's create an empty Object

then assign data to object then send data to API by params

  1. let objData = {}

  2. objData = postcodes

  3. Send this objData to api

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!