[Progress Communities] [Progress OpenEdge ABL] Forum Post: JsonObject Returned is "application/octet-stream: When Expecting "application/json" // Resp

Status
Not open for further replies.
V

v205

Guest
Hello: Hope you all had relaxing holidays. So, I am trying a POST request while using the .Net.HTTP classes inside OpenEdge 11.7.2. The endpoint in question is a REST API endpoint that expects JSON and returns JSON. The request and response are good using Postman. When I use SampleX.p to call the apiPost method inside RestConnector.cls (both programs are attached), instead of getting oResp:ContentType of "application/json", I am getting "application/octet-stream". Please note that the host, URI and other related parameters are deconstructed from a DB record inside the connectEndpoint METHOD. I have checked all of these parameters and they are formed correctly. Upon more research, I came across this KB entry that talks about the response being truncated: Progress KB - Empty or incomplete HTTPS response body in HTTP client After reading this article, I decided to examine the contents of the response and sure enough, I see a partial entry in the response: "Success (note the ending "" missing) Where it should be "Success" The debugging code that shows the response converted into character from the memptr is also at the end of the apiPost method inside RestConnector.cls Below is the JSON that is POST'ed to this endpoint: https://webservices.i-parcel.com/api/SubmitCatalog { "key": "keyObscured", "SKUs": [ { "SKU": "Product123", "Length": 1.0, "Width": 1.0, "Height": 1.0, "Weight": 1.0, "CurrentPrice": 12.35, "SKN": "p123", "CountryOfOrigin": "CN", "ProductName": "TestProduct", "ProductURL": "http:\/\/exampe.com\/product123" } ] } I am wondering at this point if this is a bug, or is it something I am not using correctly. Any help is much appreciated! Thanks,(Please visit the site to view this file)(Please visit the site to view this file)

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