Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
keeleliin
keeleliin-wrapper
Commits
6ca6c4fd
Commit
6ca6c4fd
authored
Jun 19, 2015
by
priit
Browse files
KEELELIIN-40
parent
5c89e673
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmp_tests/postTest.js
0 → 100644
View file @
6ca6c4fd
/**
* suurte failide upload test
*/
var
request
=
require
(
'
request
'
);
var
fs
=
require
(
'
fs
'
);
var
config
=
require
(
'
../config
'
);
var
url
=
'
http://127.0.0.1:
'
+
config
.
port
+
'
/api/v1/service
'
;
var
path
=
'
list
'
;
var
formData
=
{
"
service[meta][isAsync]
"
:
"
0
"
,
"
service[pipecontent][content]
"
:
'
data
'
,
file1
:
{
value
:
fs
.
createReadStream
(
path
),
options
:
{
filename
:
'
topsecret.json
'
,
contentType
:
'
text/json
'
}
},
file2
:
{
value
:
fs
.
createReadStream
(
path
),
options
:
{
filename
:
'
topsecret.json
'
,
contentType
:
'
text/json
'
}
},
file3
:
{
value
:
fs
.
createReadStream
(
path
),
options
:
{
filename
:
'
topsecret.json
'
,
contentType
:
'
text/json
'
}
},
file4
:
{
value
:
fs
.
createReadStream
(
path
),
options
:
{
filename
:
'
topsecret.json
'
,
contentType
:
'
text/json
'
}
},
file5
:
{
value
:
fs
.
createReadStream
(
path
),
options
:
{
filename
:
'
topsecret.json
'
,
contentType
:
'
text/json
'
}
}
};
request
.
post
(
{
url
:
url
,
formData
:
formData
},
function
(
err
,
resp
,
body
)
{
if
(
err
)
{
console
.
log
(
'
Error!
'
);
}
else
{
console
.
log
(
'
URL:
'
+
body
);
}
});
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment