File: simple_multipart.htb

package info (click to toggle)
httest 2.2.6-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 4,188 kB
  • sloc: ansic: 17,134; sh: 10,389; makefile: 490; lisp: 145
file content (35 lines) | stat: -rw-r--r-- 632 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Implements a simple way to build up a multipart post body
#

MODULE SIMPLE

BLOCK _FORM_MULTIPART : HOOK
_SET HOOK=---------------------------108697810410710530441715222927
__Content-Type: multipart/form-data; boundary=$HOOK
__
END

BLOCK _FORM_MULTIPART_ARG HOOK VAR VAL
_URLENC "$VAL" VALUE
__$HOOK
__Content-Disposition: form-data; name="$VAR"
__
__$VALUE
END

BLOCK _FORM_MULTIPART_FILE HOOK ITEM FILENAME
__$HOOK
__Content-Disposition: form-data; name="$ITEM"; filename="$FILENAME"
__Content-Type: application/x-tar
__
_PIPE
_EXEC cat $NAME
__
END

BLOCK _FORM_MULTIPART_END HOOK
__${HOOK}--
_SIMPLE:FOLLOW
_PLAY SOCKET
END