ABAP - call API with x-www-form-urlencoded
怎么在ABAP里调用API传入x-www-form-urlencoded参数比如在postman里是这样传的TYPES: BEGIN OF ty_resp,token_type TYPE string,expires_in TYPE i,ext_expires_in TYPE i,access_token TYPE string,END OF ty_resp.DATA: lo_client TYPE REF TO if_http_client,lt_form_fields TYPE tihttpnvp,lv_status_code TYPE i,lv_response TYPE string,ls_resp TYPE ty_resp.**********************************************************************CALL METHOD cl_http_clientcreate_by_urlEXPORTINGurl gv_token_urlIMPORTINGclient lo_clientEXCEPTIONSargument_not_found 1plugin_not_active 2internal_error 3pse_not_found 4pse_not_distrib 5pse_errors 6OTHERS 7.CHECK lo_client IS BOUND.lo_client-propertytype_logon_popup lo_client-co_disabled. Turn Off logon Popuplo_client-request-set_method( POST ).lo_client-request-set_content_type( content_type if_rest_media_typegc_appl_www_form_url_encoded ).lo_client-response-if_http_entity~set_content_type( content_type if_rest_media_typegc_appl_json ).APPEND VALUE #( name grant_type value client_credentials ) TO lt_form_fields.APPEND VALUE #( name client_id value gv_token_client_id ) TO lt_form_fields.APPEND VALUE #( name client_secret value gv_token_client_secret ) TO lt_form_fields.APPEND VALUE #( name scope value gv_token_scope ) TO lt_form_fields.lo_client-request-set_form_fields( lt_form_fields ).CALL METHOD lo_client-send(EXCEPTIONShttp_communication_failure 1http_invalid_state 2http_processing_failed 3http_invalid_timeout 4OTHERS 5 ).get responseCALL METHOD lo_client-receive(EXCEPTIONShttp_communication_failure 1http_invalid_state 2http_processing_failed 3OTHERS 4 ).CALL METHOD lo_client-response-get_statusIMPORTINGcode lv_status_code.lv_response lo_client-response-get_cdata( ).CALL METHOD /ui2/cl_jsondeserializeEXPORTINGjson lv_responsepretty_name /ui2/cl_jsonpretty_mode-noneassoc_arrays abap_trueCHANGINGdata ls_resp.gv_access_token ls_resp-access_token.