[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Handling blank body in request [ REST] while receiving it as prodataset

Status
Not open for further replies.
E

egarcia

Guest
Hello, > I have written my code in such a way that receiving a JSON object as prodataset in my rest program. When I am passing blank > dataset [ nothing in body], I am getting the following error. My rest program is not getting called at all. Here is what I think is happening. An empty body is not a valid dataset. The validation that you see happens prior to the program being called. The program would be called with a valid dataset. A blank dataset would be something like the following: { "dsTraveler": { "ttTraveler": [] } } A possible way to detect the case of an empty body in the HTTP request, would be to have the procedure receive a LONGCHAR parameter and then do the conversion from string to a JSON DATASET. Here you would have a chance to catch exceptions. I hope this helps.

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