1. Ana Suárez Muñiz
  2. Elevate Discussion
  3. Friday, 16 April 2021 06:59 AM UTC
Can this be sent with httpclient object?

<html>
<head>
<title>DocPop Test </title>
</head>
<body>
<form method="post" action= "https://webserer/AppNet/DocPop/DocPop.aspx">
<input type=hidden" name="clienttype" value= "html">
<input type=hidden" name="doctypeid" value= "137">
<input type=hidden" name="KT!!%_0_0_0" value= "0010171">
<input type=submit" value= "submit">
</form>
</body>
</html>

Thanks
Daryl Foster Accepted Answer Pending Moderation
  1. Friday, 16 April 2021 09:00 AM UTC
  2. Elevate Discussion
  3. # 1

Hi Ana,

Here is a basic example of sending a urlencoded form. You could try something like this:

 

integer li_response
string ls_responsebody
string ls_responsestatustext
string ls_body
string ls_url
integer li_rc

ls_url = 'https://webserer/AppNet/DocPop/DocPop.aspx'

// The keys and values may need to be url encoded, I'm not sure if they are automatically done
ls_body = 'clienttype=html'
ls_body += '&doctypeid=137'
ls_body += '&KT!!%_0_0_0=0010171'

HttpClient lo_httpclient
lo_httpclient = Create HttpClient

lo_httpclient.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')

li_rc = lo_httpclient.SendRequest('POST', ls_url, ls_body)

if li_rc = 1 then

    // Do something with the response
    ls_responsestatustext = lo_httpclient.GetResponseStatusText()
    li_response = lo_httpclient.GetResponseStatusCode()
    li_rc = lo_httpclient.GetResponseBody(ls_responsebody)
else
    // Something went wrong
end if
destroy lo_httpclient

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.