[Progress Communities] [Progress OpenEdge ABL] Forum Post: Requestbuilder post returns statuscode 404 OE 11.7

  • Thread starter Thread starter JohanBeumer
  • Start date Start date
Status
Not open for further replies.
J

JohanBeumer

Guest
HI, The following code works fine with OE 11.6.2, but fails with 11.7 De request.log points to C:\Temp\request-raw.txt which containes the following : OpenEdge 11.7 POST /?token=AwYAAAD57FoHGPLsV4Z3UbF+HOUcwUsVYFJ+hli2hLE5NLyL2AnJD50x9eitoUyYaMLasiPCvJyKY1cmFvSi0E+xFrQSPCmDEDL0019wmJSU9aKSKjR2f6MAlNlzd8t4iutjnjM= HTTP/1.1 OpenEdge 11.6.2 POST /?token=AwYAAAD57FoHGPLsV4Z3UbF%2BHOUcwUsVYFJ%2Bhli2hLE5NLyL2AnJD50x9eitoUyYaMLasiPCvJyKY1cmFvSi0E%2BxFrQSPCmDEDL0019wmJSU9aKSKjR2f6MAlNlzd8t4iutjnjM%3D HTTP/1.1 I found Progress KB - URI:Encode works differently in 11.7; encodes the equal sign. and base on that article I constructed the url as is done for variable oURI2 in the code. In that case both 11.6.2 and 11.7 fail the request. The query string in C:\Temp\request-raw.txt is : POST /?token=AwYAAAD57FoHGPLsV4Z3UbF%252BHOUcwUsVYFJ%252Bhli2hLE5NLyL2AnJD50x9eitoUyYaMLasiPCvJyKY1cmFvSi0E%252BxFrQSPCmDEDL0019wmJSU9aKSKjR2f6MAlNlzd8t4iutjnjM%253D HTTP/1.1 Can anyone point me in the right direction to make this work for 11.7? What am I doing wrong? Thnx in advance! Kind regards, Johan Beumer using OpenEdge.Net.*. using OpenEdge.Net.HTTP.IHttpRequest. using OpenEdge.Net.HTTP.IHttpResponse. using OpenEdge.Net.HTTP.RequestBuilder. using OpenEdge.Net.HTTP.ClientBuilder. using OpenEdge.Core.String. define variable oRequest as IHttpRequest no-undo. define variable oRequestBody as String no-undo. define variable cToken as character no-undo. define variable oResponse as IHttpResponse no-undo. define variable cChannel as character no-undo. define variable oURI as URI no-undo. define variable oURI2 as URI no-undo. session:error-stack-trace = true. session:debug-alert = true. log-manager:logfile-name = 'request.log'. log-manager:logging-level = 6. log-manager:clear-log(). cToken = "MySecretToken". cChannel = "https://bl2p.notify.windows.com/?to...SPCmDEDL0019wmJSU9aKSKjR2f6MAlNlzd8t4iutjnjM=". oRequestBody = new String(' '). oURI = URI:Parse(cChannel). oURI2 = OpenEdge.Net.URI:Parse(oURI:BaseURI). oURI2:AddQuery("token",URI:encode(oURI:GetQueryValue("token"), UriEncodingTypeEnum:default)). oRequest = RequestBuilder:Post(oURI / oURI2, oRequestBody) :ContentType("text/xml") :AddHeader("X-WNS-Type", "wns/toast") :AddHeader("Authorization", "Bearer " + cToken) :Request. oResponse = ClientBuilder:Build():Client:Execute(oRequest). message oResponse:statuscode skip view-as alert-box information buttons ok.

Continue reading...
 
Status
Not open for further replies.
Back
Top