Skip to content

Commit 758976c

Browse files
committed
Respect RequestOnly if passed in config
1 parent fa1deca commit 758976c

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

source/HttpCommand.dyalog

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:Class HttpCommand
1+
:Class HttpCommand
22
General HTTP Commmand utility
33
Documentation is found at https://dyalog.github.io/HttpCommand/
44

@@ -7,7 +7,7 @@
77
rVersion
88
Return the current version
99
:Access public shared
10-
r'HttpCommand' '5.10.0' '2026-02-06'
10+
r'HttpCommand' '5.10.1' '2026-02-11'
1111
1212

1313
Request-related fields
@@ -191,7 +191,9 @@
191191
:Else
192192
r##.⎕NEW(⊃⊃⎕CLASS ⎕THIS)(eis(9.1nameClassargs)args)
193193
:EndIf
194-
r.RequestOnlyrequestOnly
194+
:If requestOnly¯1
195+
r.RequestOnlyrequestOnly
196+
:EndIf
195197
:Else
196198
rinitResult #.⎕NS''
197199
r.(rc msg)¯1 ⎕DMX.EM
@@ -1533,17 +1535,17 @@
15331535
ParseUrlEncodedForm r;data;name;value;formData
15341536
parse application/x-www-form-urlencoded content
15351537
:Trap 0
1536-
dataUrlDecode¨¨(r.Data splitOn'&')splitOn¨'='
1537-
formData⎕NS''
1538-
:For (name value) :In data
1539-
Oops('.'name)¯1=⎕NC name
1540-
:If 0=formData.⎕NC name formData{,'←⍬'}name :EndIf
1541-
formData(name{⍺⍺,',←⍵'})value
1542-
:EndFor
1543-
r.DataformData
1538+
dataUrlDecode¨¨(r.Data splitOn'&')splitOn¨'='
1539+
formData⎕NS''
1540+
:For (name value) :In data
1541+
Oops('.'name)¯1=⎕NC name
1542+
:If 0=formData.⎕NC name formData{,'←⍬'}name :EndIf
1543+
formData(name{⍺⍺,',←⍵'})value
1544+
:EndFor
1545+
r.DataformData
15441546
:Else
15451547
Oops:
1546-
r.(rc msg)¯2 'Could not translate URL Encoded Form payload'
1548+
r.(rc msg)¯2 'Could not translate URL Encoded Form payload'
15471549
:EndTrap
15481550
15491551

0 commit comments

Comments
 (0)