File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- :Class HttpCommand
1+ :Class HttpCommand
22⍝ General HTTP Commmand utility
33⍝ Documentation is found at https://dyalog.github.io/HttpCommand/
44
77 ∇ r ← Version
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
191191 :Else
192192 r ← ## . ⎕NEW (⊃⊃ ⎕CLASS ⎕THIS )(eis ⍣ (9.1 ≠ nameClass ⊃ args )⊢ args )
193193 :EndIf
194- r . RequestOnly ← requestOnly
194+ :If requestOnly ≠ ¯1
195+ r . RequestOnly ← requestOnly
196+ :EndIf
195197 :Else
196198 r ← initResult # . ⎕NS ' '
197199 r . (rc msg )← ¯1 ⎕DMX .EM
15331535 ∇ ParseUrlEncodedForm r ;data;name;value;formData
15341536 ⍝ parse application/x-www-form-urlencoded content
15351537 :Trap 0
1536- data ← UrlDecode ¨¨ (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 . Data ← formData
1538+ data ← UrlDecode ¨¨ (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 . Data ← formData
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
You can’t perform that action at this time.
0 commit comments