Handbook
Glossary
parse-curl-command ( string method -- request )
Vocabulary
chrome-tools
Inputs
string
an
object
method
an
object
Outputs
request
an
object
Definition
USING:
accessors
combinators
http
kernel
sequences
splitting
urls
;
IN:
chrome-tools
:
parse-curl-command
( string method -- request )
[
trim-curl-command
]
[
<request>
swap
>>method
]
bi*
swap
[
" "
split1
swap
{
{
[
dup
"curl"
=
]
[
drop
trim-squotes
>url
[
>>url
]
curry
]
}
{
[
dup
"-H"
=
]
[
drop
parse-key-value
dup
"if-modified-since"
=
[
2drop
f
]
[
~quotation~
2curry
]
if
]
}
{
[
dup
"--compressed"
=
]
[
2drop
f
]
}
{
[
dup
"--data-raw"
=
]
[
drop
trim-squotes
[
>>post-data
]
curry
]
}
[
2drop
f
]
}
cond
]
map
[
]
concat-as
curry
( -- request )
call-effect
;