[Progress Communities] [Progress OpenEdge ABL] Forum Post: Parsing x-www-form-urlencoded from Memptr is missing last character

  • Thread starter Thread starter brianlafertewk
  • Start date Start date
Status
Not open for further replies.
B

brianlafertewk

Guest
This morning I was working with a web handler request that needs to receive data with a content type of "application/x-www-form-urlencoded". I thought this would be pretty easy, and it was ... until I noticed that I am missing the last character. I am being sent a string that looks normal enough -> field1=AB&field2=CD I am parsing the data from the poRequest:Entity using the command lcData = CAST(poRequest.Entity,OpenEdge.Core.Memptr):GetString(1). Using that command, the value in lcData shows as "field1=AB&field2=C". Notice the 'D' is missing. Originally the data was coming from a .Net HttpClient call. I made the same call using Postman, using x-www-form-urlencoded as the body type, and I receive the same result. To get around the issue for today, I decided to go old school and get the value off of WEB-CONTEXT:FORM-INPUT. When getting the data from there, the full string is retrieved (including the 'D'). Am I doing something wrong in my assignment? Is there a 'better' way to get 'x-www-form-urlencoded' data from the poRequest that I've missed?

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