Skip to content

abapPM/ABAP-URL

Version

License Contributor Covenant REUSE Status

URL Object

Full implementation of the WHATWG URL Standard.

NO WARRANTIES, MIT License

┌────────┬──┬──────────┬──────────┬─────────────────┬──────┬──────────┬─┬──────────────┬──────────┐
" https:  //    user   :   pass   @ sub.example.com : 8080   /p/a/t/h  ?  query=string     #hash  "
│ scheme │  │ username │ password │    host         │ port │   path   │ |    query     │ fragment │
├────────┴──┴──────────┴──────────┴─────────────────┴──────┴──────────┴─┴──────────────┴──────────┤
│                                            url                                                  │
└─────────────────────────────────────────────────────────────────────────────────────────────────┘
(All spaces in the "" line should be ignored. They are purely for formatting.)

Usage

Parse a URL into its components:

DATA(url) = /apmg/cl_url=>parse( 'https://example.com/path?query#fragment' ).

" url->components-scheme   = 'https'
" url->components-host     = 'example.com'
" url->components-path     = '/path'
" url->components-query    = 'query'
" url->components-fragment = 'fragment'

Serialize a URL from components:

DATA(components) = VALUE /apmg/cl_url=>ty_url_components(
  scheme   = 'https'
  username = 'user'
  password = 'pass'
  host     = 'example.com'
  port     = '8080'
  path     = '/path/to/resource'
  query    = 'key=value'
  fragment = 'section' ).

DATA(url_string) = /apmg/cl_url=>serialize( components ).

" url_string = 'https://user:pass@example.com:8080/path/to/resource?key=value#section'

Prerequisites

SAP Basis 7.50 or higher

Limitations

There's no support for Punycode (should be a separate package).

Installation

Install url as a global module in your system using apm.

or

Specify the url module as a dependency in your project and import it to your namespace using apm.

Contributions

All contributions are welcome! Read our Contribution Guidelines, fork this repo, and create a pull request.

You can install the developer version of ABAP URL using abapGit by creating a new online repository for https://github.com/abapPM/ABAP-URL.

Recommended SAP package: /APMG/URL

About

Made with ❤ in Canada

Copyright 2025 apm.to Inc. https://apm.to

Follow @marcf.be on Bluesky and @marcfbe or LinkedIn

About

URL Object for ABAP

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Contributors

Languages

Generated from abapPM/Template-for-ABAP