Skip to content

Commit

Permalink
additional cl_web_http_utility methods
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp committed Jul 3, 2024
1 parent f622758 commit c72d007
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
},
"license": "MIT",
"dependencies": {
"@abaplint/cli": "^2.110.4",
"@abaplint/cli": "^2.110.5",
"@abaplint/database-sqlite": "^2.8.25",
"@abaplint/runtime": "^2.8.27",
"@abaplint/transpiler-cli": "^2.8.27",
"@abaplint/runtime": "^2.8.28",
"@abaplint/transpiler-cli": "^2.8.28",
"0x": "^5.7.0"
}
}
22 changes: 22 additions & 0 deletions src/http/cl_web_http_utility.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,31 @@ CLASS cl_web_http_utility DEFINITION PUBLIC.
unencoded TYPE xstring
RETURNING
VALUE(encoded) TYPE string.

CLASS-METHODS decode_base64
IMPORTING
encoded TYPE string
RETURNING
VALUE(decoded) TYPE string.

CLASS-METHODS encode_base64
IMPORTING
unencoded TYPE string
RETURNING
VALUE(encoded) TYPE string.

ENDCLASS.

CLASS cl_web_http_utility IMPLEMENTATION.

METHOD decode_base64.
decoded = cl_abap_codepage=>convert_from( cl_http_utility=>decode_x_base64( encoded ) ).
ENDMETHOD.

METHOD encode_base64.
encoded = cl_http_utility=>encode_x_base64( cl_abap_codepage=>convert_to( unencoded ) ).
ENDMETHOD.

METHOD unescape_url.
unescaped = cl_http_utility=>unescape_url(
escaped = escaped
Expand Down

0 comments on commit c72d007

Please sign in to comment.