Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Methods for HTTP post

Former Member
0 Likes
496

Hello Expert,

I am tring to do an HTTP post, using the method 'cl_gui_frontend_services=>execute'.

However, I am not able to do so, when I am trying to do a get using the same method, it works fine.

I am sure there would be multiple posts on the forum regarding the issue but I am not able to find anything relevant.

If you could provide a solution or any post which is similar, it would be great.

Thanks in advance.

2 REPLIES 2
Read only

former_member202771
Contributor
0 Likes
433

Hi Anurag,

What is the error you are getting?

BR,

Anil

Read only

0 Likes
433

I am not getting eny error.

The below GET method is working fine:

data: l_url_doculink type string.

l_url_doculink = 'http://198.101.151.32/ReadHttp/Getparameters.aspx?userPassword=vikesh'.

CALL METHOD cl_gui_frontend_services=>execute

     EXPORTING

       document = l_url_doculink

     EXCEPTIONS

       OTHERS   = 1.

if sy-subrc = 0.

   write: 'url opened'.

else.

   write:'method call failed with sy-subrc'.

endif.

----------------------------------------------------------------------------------------------------------------------------------

HOwever when I am trying to POST using below code it is not working

data: l_url_doculink type string.

data: parameter_url type string.

  l_url_doculink = 'http://198.101.151.32/Readhttp/PostParameter.aspx'.

parameter_url =

'userPassword=vikesh*123&userName=vikesh&subUserId=vksh1&jobId=1001&secretKey=aC4adsTYgqipm&successPageUrlRedirect=http://198.101.151.32/Readhttp/PostParameter.aspx&failurePageUrlRedirect=http://localhost:64934/Read...'.

CALL METHOD cl_gui_frontend_services=>execute

     EXPORTING

       document = l_url_doculink

       parameter = parameter_url

     EXCEPTIONS

       OTHERS   = 1.

if sy-subrc = 0.

   write: 'url opened'.

else.

   write:'method call failed with sy-subrc'.

endif.

Kindly help.