Skip to content

Commit 5e4c220

Browse files
authored
Merge pull request #7 from Silverdark/dev/file-to-large
Replace PUT upload with POST to be able to transmit more than 20'000'000 characters
2 parents 3855b01 + 597c2f8 commit 5e4c220

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

UploadBOM/src/dtrackClient.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class DTrackClient {
1818
return new Promise((resolve, reject) => {
1919
request('/api/v1/bom', {
2020
...this.baseOptions,
21-
method: 'PUT',
22-
body: {
21+
method: 'POST',
22+
formData: {
2323
"project": projId,
24-
"bom": bom.toString('base64')
24+
"bom": bom.toString()
2525
}
2626
},
2727
(error, response) => {
@@ -38,12 +38,12 @@ class DTrackClient {
3838
return new Promise((resolve, reject) => {
3939
request('/api/v1/bom', {
4040
...this.baseOptions,
41-
method: 'PUT',
42-
body: {
43-
"autoCreate": true,
41+
method: 'POST',
42+
formData: {
43+
"autoCreate": 'true',
4444
"projectName": name,
4545
"projectVersion": version,
46-
"bom": bom.toString('base64')
46+
"bom": bom.toString()
4747
}
4848
},
4949
(error, response) => {

0 commit comments

Comments
 (0)