Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const uri = `${_REST_URL_}/reimbursement/testing.php`
- const formData = new FormData();
- formData.append('nip', this.props.User.nip)
- formData.append('rei_id', this.props.jenisKlaim[this.state.jenis].rei_id)
- formData.append('tanggal_permintaan', this.state.tgl_permintaan)
- formData.append('jumlah_klaim', this.state.jml_klaim)
- formData.append('image', {
- uri: this.state.fileUri.replace('content','file'),
- type: this.state.fileType,
- name: this.state.fileName
- })
- formData.append('Content-Type', this.state.fileType)
- fetch(uri, {
- method: 'POST',
- headers: {
- 'Content-Type': 'multipart/form-data',
- },
- body: formData
- })
- // .then((response) => response.json())
- .then((responseJson) => {
- console.log(responseJson)
- })
- .catch((error) => {
- console.log(error)
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement