1. Allen Hogan
  2. PowerBuilder
  3. Wednesday, 6 December 2017 21:22 PM UTC

Is there a solution for the current PB limitation using PostURL that only allows for http and not https?

-Allen

Allen Hogan Accepted Answer Pending Moderation
  1. Thursday, 7 December 2017 16:17 PM UTC
  2. PowerBuilder
  3. # 1

Thank you!  I will look into these options.

Comment
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Thursday, 7 December 2017 10:06 AM UTC
  2. PowerBuilder
  3. # 2

Hi Allen,

here the code that you can run from Powerbuilder. Adapt according to the authorizations you must supply.

string ls_post_url, ls_post_variables, ls_status_text, ls_response_text
long ll_status_code
OleObject loo_xmlhttp
loo_xmlhttp = CREATE oleobject
loo_xmlhttp.ConnectToNewObject("Msxml2.XMLHTTP.6.0")
ls_post_url='https://myHTTPSserver'
ls_post_variables='key=value'  // if you need
// send the POST
loo_xmlhttp.open ("POST",ls_post_url, false)
loo_xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
loo_xmlhttp.setRequestHeader( "Authorization", "put here your auth code if any" )
loo_xmlhttp.send(ls_post_variables)
//Get your response
ls_status_text = loo_xmlhttp.StatusText
ll_status_code =  loo_xmlhttp.Status
//Get the response we received from the web server
ls_response_text = loo_xmlhttp.ResponseText
loo_xmlhttp.DisconnectObject()

destroy loo_xmlhttp

If ll_status_code <> 201 Then
    MessageBox("HTTPS POST failed", ls_status_text)
End If

Cheers,

Marco

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 7 December 2017 06:30 AM UTC
  2. PowerBuilder
  3. # 3

You may use Microsoft XML ActiveX.

Comment
There are no comments made yet.
Mike S Accepted Answer Pending Moderation
  1. Wednesday, 6 December 2017 21:46 PM UTC
  2. PowerBuilder
  3. # 4

http://www.topwizprogramming.com/freecode_winhttp.html

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.