{"id":13698877,"url":"https://github.com/sbcgua/abap-http-agent","last_synced_at":"2025-05-12T19:12:02.328Z","repository":{"id":40641276,"uuid":"277273199","full_name":"sbcgua/abap-http-agent","owner":"sbcgua","description":"AHA - abap http agent, convenience wrapper over cl_http_client","archived":false,"fork":false,"pushed_at":"2022-09-21T19:17:11.000Z","size":42,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T19:11:53.238Z","etag":null,"topics":["abap","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"ABAP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbcgua.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-05T09:52:10.000Z","updated_at":"2025-02-22T17:24:01.000Z","dependencies_parsed_at":"2023-01-17T16:49:48.528Z","dependency_job_id":null,"html_url":"https://github.com/sbcgua/abap-http-agent","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbcgua%2Fabap-http-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbcgua%2Fabap-http-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbcgua%2Fabap-http-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbcgua%2Fabap-http-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbcgua","download_url":"https://codeload.github.com/sbcgua/abap-http-agent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253805854,"owners_count":21967053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abap","hacktoberfest"],"created_at":"2024-08-02T19:00:54.154Z","updated_at":"2025-05-12T19:12:02.309Z","avatar_url":"https://github.com/sbcgua.png","language":"ABAP","readme":"![abaplint](https://github.com/sbcgua/abap-http-agent/workflows/abaplint/badge.svg)\n![abap package version](https://img.shields.io/endpoint?url=https://shield.abap.space/version-shield-json/github/sbcgua/abap-http-agent/src/zif_aha_http_agent.intf.abap)\n\n# AHA - abap http agent\n\nConvenience wrapper over cl_http_client\n\nWIP\n\nTODO:\n- url destination\n- integrate with json ?\n- proxy ?\n- resumable password exception ?\n\n## Example\n\n### GET\n\n```abap\ndata lt_query type zif_aha_http_agent=\u003etty_key_value.\ndata lt_header type zif_aha_http_agent=\u003etty_key_value.\nfield-symbols \u003ce\u003e like line of lt_query.\n\nappend initial line to lt_query assigning \u003ce\u003e.\n\u003ce\u003e-key = 'id'.\n\u003ce\u003e-val = '1234'.\nappend initial line to lt_header assigning \u003ce\u003e.\n\u003ce\u003e-key = 'content-type'.\n\u003ce\u003e-val = 'application/json'.\n\ndata lo_agent type ref to zif_aha_http_agent.\ndata li_resp type ref to zif_aha_http_response.\nlo_agent = zcl_aha_http_agent=\u003ecreate( iv_destination = 'MYDESTINATION' ).\n\nli_resp = lo_agent-\u003erequest(\n    iv_uri     = 'service/1'\n    it_query   = lt_query\n    it_headers = lt_header ).\n\nif li_resp-\u003eis_ok( ) = abap_true.\n    do_my_processing( li_resp-\u003edata( ) ).\nelse.\n    report_error( li_resp-\u003eerror( ) ).\nendif.\n```\n\nheaders and query integrates well with [abap-string-map](https://github.com/sbcgua/abap-string-map)\n\n```abap\ndata lo_query type ref to zcl_abap_string_map.\ncreate object lo_query.\n\nlo_query-\u003eset( iv_key = 'id' iv_val = '1234' ).\n...\nli_resp = lo_agent-\u003erequest(\n    iv_uri     = 'service/1'\n    it_query   = lo_query-\u003emt_entries ).\n```\n\n### POST\n\n```abap\ndata lo_agent type ref to zif_aha_http_agent.\nlo_agent = zcl_aha_http_agent=\u003ecreate( iv_destination = 'MYDESTINATION' ).\n\ndata lv_payload type xstring value '102030'.\n\nlo_agent-\u003erequest(\n    iv_method  = zif_aha_http_response=\u003ec_methods-post\n    iv_uri     = 'service/1'\n    iv_payload = lv_payload ).\n```\n\n### Multipart payload\n\n```abap\ndata lt_multipart type zif_aha_http_agent=\u003ett_multipart.\nfield-symbols \u003cmp\u003e like line of lt_multipart.\nappend initial line to lt_multipart assigning \u003cmp\u003e.\n\u003cmp\u003e-content_type = 'application/pdf'.\n\u003cmp\u003e-data         = 'some binary data here...'.\n\u003cmp\u003e-filename     = 'myfile.pdf'.\n\u003cmp\u003e-name         = 'myfile'.\n\nlo_cut-\u003erequest(\n    iv_method  = zif_aha_http_response=\u003ec_methods-post\n    iv_uri     = 'service/1'\n    iv_payload = lt_multipart ).\n```\n\n","funding_links":[],"categories":["Categories"],"sub_categories":["🐝 API \u0026 Services"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbcgua%2Fabap-http-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbcgua%2Fabap-http-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbcgua%2Fabap-http-agent/lists"}