Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .abapgit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<MIN_RELEASE>750</MIN_RELEASE>
</item>
</REQUIREMENTS>
<VERSION_CONSTANT>ZIF_HTTP_AGENT=&gt;C_VERSION</VERSION_CONSTANT>
<VERSION_CONSTANT>/APMG/IF_HTTP_AGENT=&gt;C_VERSION</VERSION_CONSTANT>
</DATA>
</asx:values>
</asx:abap>
80 changes: 45 additions & 35 deletions abaplint.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
{
"files": "/src/**/*.*",
"folder": "/deps3",
"url": "https://github.com/sbcgua/abap-string-map"
"url": "https://github.com/abapPM/ABAP-Url"
},
{
"files": "/src/**/*.*",
"folder": "/deps4",
"url": "https://github.com/sbcgua/abap-string-map"
},
{
"files": "/src/**/*.*",
"folder": "/deps5",
"url": "https://github.com/sbcgua/ajson"
}
],
Expand All @@ -43,7 +48,12 @@
"align_type_expressions": true,
"allowed_object_naming": true,
"allowed_object_types": {
"allowed": ["CLAS", "DEVC", "INTF"]
"allowed": [
"CLAS",
"DEVC",
"INTF",
"NSPC"
]
},
"ambiguous_statement": true,
"avoid_use": true,
Expand Down Expand Up @@ -176,41 +186,41 @@
"no_yoda_conditions": true,
"nrob_consistency": true,
"object_naming": {
"aqbg": "^ZABAPPM",
"aqqu": "^ZABAPPM",
"aqsg": "^ZABAPPM",
"auth": "^ZABAPPM",
"clas": "^ZC(L|X)\\_HTTP",
"cmod": "^ZABAPPM",
"doma": "^ZABAPPM",
"dtel": "^ZABAPPM",
"enho": "^ZABAPPM",
"enhs": "^ZABAPPM",
"enqu": "^EZABAPPM",
"form": "^ZABAPPM",
"fugr": "^ZABAPPM",
"idoc": "^ZABAPPM",
"aqbg": "^Z",
"aqqu": "^Z",
"aqsg": "^Z",
"auth": "^Z",
"clas": "^/APMG/C(L|X)_HTTP",
"cmod": "^Z",
"doma": "^Z",
"dtel": "^Z",
"enho": "^Z",
"enhs": "^Z",
"enqu": "^EZ",
"form": "^Z",
"fugr": "^Z",
"idoc": "^Z",
"ignoreNames": [],
"ignorePatterns": [],
"intf": "^ZIF\\_HTTP",
"msag": "^ZABAPPM",
"intf": "^/APMG/IF_HTTP",
"msag": "^Z",
"patternKind": "required",
"pinf": "^ZABAPPM",
"prog": "^ZABAPPM",
"sfpf": "^ZABAPPM",
"sfpi": "^ZABAPPM",
"shlp": "^ZABAPPM",
"ssfo": "^ZABAPPM",
"ssst": "^ZABAPPM",
"sucu": "^ZABAPPM",
"suso": "^ZABAPPM",
"sxci": "^ZABAPPM",
"tabl": "^ZABAPPM",
"tran": "^ZABAPPM",
"ttyp": "^ZABAPPM",
"wdya": "^ZABAPPM",
"wdyn": "^ZABAPPM",
"xslt": "^ZABAPPM"
"pinf": "^Z",
"prog": "^Z",
"sfpf": "^Z",
"sfpi": "^Z",
"shlp": "^Z",
"ssfo": "^Z",
"ssst": "^Z",
"sucu": "^Z",
"suso": "^Z",
"sxci": "^Z",
"tabl": "^Z",
"tran": "^Z",
"ttyp": "^Z",
"wdya": "^Z",
"wdyn": "^Z",
"xslt": "^Z"
},
"obsolete_statement": true,
"omit_parameter_name": true,
Expand Down Expand Up @@ -279,7 +289,7 @@
"xml_consistency": true
},
"syntax": {
"errorNamespace": "^(Z|Y|LCL_|TY_|LIF_)",
"errorNamespace": "^(/APMG/|LCL_|TY_|LIF_)",
"globalConstants": [],
"globalMacros": [],
"version": "v750"
Expand Down
16 changes: 16 additions & 0 deletions src/#apmg#.nspc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_NSPC" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<NSPC>
<NAMESPACE>/APMG/</NAMESPACE>
<REPLICENSE>41813564412598342476</REPLICENSE>
</NSPC>
<NSPC_TEXT>
<SPRAS>E</SPRAS>
<DESCRIPTN>apm</DESCRIPTN>
<OWNER>apm.to Inc.</OWNER>
</NSPC_TEXT>
</asx:values>
</asx:abap>
</abapGit>
26 changes: 13 additions & 13 deletions src/zcl_http_agent.clas.abap → src/#apmg#cl_http_agent.clas.abap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CLASS zcl_http_agent DEFINITION
CLASS /apmg/cl_http_agent DEFINITION
PUBLIC
FINAL
CREATE PRIVATE.
Expand All @@ -11,11 +11,11 @@ CLASS zcl_http_agent DEFINITION
************************************************************************
PUBLIC SECTION.

INTERFACES zif_http_agent.
INTERFACES /apmg/if_http_agent.

CLASS-METHODS create
RETURNING
VALUE(result) TYPE REF TO zif_http_agent.
VALUE(result) TYPE REF TO /apmg/if_http_agent.

METHODS constructor.

Expand All @@ -29,13 +29,13 @@ CLASS zcl_http_agent DEFINITION
request TYPE REF TO if_http_request
payload TYPE any
RAISING
zcx_error.
/apmg/cx_error.

ENDCLASS.



CLASS zcl_http_agent IMPLEMENTATION.
CLASS /apmg/cl_http_agent IMPLEMENTATION.


METHOD attach_payload.
Expand All @@ -50,7 +50,7 @@ CLASS zcl_http_agent IMPLEMENTATION.
WHEN cl_abap_typedescr=>typekind_char.
request->set_cdata( |{ payload }| ).
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_error_text
RAISE EXCEPTION TYPE /apmg/cx_error_text
EXPORTING
text = |Unexpected payload type { payload_type->absolute_name }|.
ENDCASE.
Expand All @@ -67,19 +67,19 @@ CLASS zcl_http_agent IMPLEMENTATION.

METHOD create.

result = NEW zcl_http_agent( ).
result = NEW /apmg/cl_http_agent( ).

ENDMETHOD.


METHOD zif_http_agent~global_headers.
METHOD /apmg/if_http_agent~global_headers.

result = global_headers.

ENDMETHOD.


METHOD zif_http_agent~request.
METHOD /apmg/if_http_agent~request.

DATA:
http_client TYPE REF TO if_http_client,
Expand Down Expand Up @@ -119,9 +119,9 @@ CLASS zcl_http_agent IMPLEMENTATION.
ENDLOOP.
ENDIF.

IF method = zif_http_agent=>c_method-post
OR method = zif_http_agent=>c_method-put
OR method = zif_http_agent=>c_method-patch.
IF method = /apmg/if_http_agent=>c_method-post
OR method = /apmg/if_http_agent=>c_method-put
OR method = /apmg/if_http_agent=>c_method-patch.
attach_payload(
request = http_client->request
payload = payload ).
Expand Down Expand Up @@ -149,7 +149,7 @@ CLASS zcl_http_agent IMPLEMENTATION.
code = status_code
message = message ).

RAISE EXCEPTION TYPE zcx_error_text
RAISE EXCEPTION TYPE /apmg/cx_error_text
EXPORTING
text = |HTTP error: [{ status_code }] { message }|.
ENDIF.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ CLASS lcl_http_response DEFINITION FINAL.

PUBLIC SECTION.

INTERFACES zif_http_response.
INTERFACES /apmg/if_http_response.

CLASS-METHODS create
IMPORTING
http_client TYPE REF TO if_http_client
RETURNING
VALUE(result) TYPE REF TO zif_http_response.
VALUE(result) TYPE REF TO /apmg/if_http_response.

PRIVATE SECTION.

Expand All @@ -29,32 +29,32 @@ CLASS lcl_http_response IMPLEMENTATION.

ENDMETHOD.

METHOD zif_http_response~close.
METHOD /apmg/if_http_response~close.

http_client->close( ).

ENDMETHOD.

METHOD zif_http_response~is_ok.
METHOD /apmg/if_http_response~is_ok.

DATA(status_code) = zif_http_response~code( ).
DATA(status_code) = /apmg/if_http_response~code( ).
result = xsdbool( status_code >= 200 AND status_code < 300 ).

ENDMETHOD.

METHOD zif_http_response~data.
METHOD /apmg/if_http_response~data.

result = http_response->get_data( ).

ENDMETHOD.

METHOD zif_http_response~cdata.
METHOD /apmg/if_http_response~cdata.

result = http_response->get_cdata( ).

ENDMETHOD.

METHOD zif_http_response~code.
METHOD /apmg/if_http_response~code.

DATA msg TYPE string ##NEEDED.

Expand All @@ -65,23 +65,23 @@ CLASS lcl_http_response IMPLEMENTATION.

ENDMETHOD.

METHOD zif_http_response~json.
METHOD /apmg/if_http_response~json.

TRY.
result = zcl_ajson=>parse( zif_http_response~cdata( ) ).
result = zcl_ajson=>parse( /apmg/if_http_response~cdata( ) ).
CATCH zcx_ajson_error INTO DATA(error).
RAISE EXCEPTION TYPE zcx_error_prev EXPORTING previous = error.
RAISE EXCEPTION TYPE /apmg/cx_error_prev EXPORTING previous = error.
ENDTRY.

ENDMETHOD.

METHOD zif_http_response~error.
METHOD /apmg/if_http_response~error.

result = http_response->get_cdata( ).

ENDMETHOD.

METHOD zif_http_response~headers.
METHOD /apmg/if_http_response~headers.

DATA headers TYPE tihttpnvp.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>ZCL_HTTP_AGENT</CLSNAME>
<CLSNAME>/APMG/CL_HTTP_AGENT</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>HTTP Agent</DESCRIPT>
<STATE>1</STATE>
Expand Down
Loading