I configured a datasnap rest server as a custom script upload location for madexcept.
Everything works fine up to the part where I try to parse the variables set in the report. They were added with
MESettings.AdditionalFields.Add('appname', '%appname%')
I recognized that the report is sent as multipart/form-data, therefore I tried including Web.ReqMulti into my unit to get the parsed with TMultipartContentParser It looks like this in the REST-method
function V1RestMethod.UpdateBugReport: TJSONArray;
var
LReq:TWebRequest;
LAppName:string;
begin
LReq:=GetDataSnapWebModule.Request;
LAppName:= LReq.ContentFields.Values['appname'];
end;
At this point, LAppName
is empty since LReq.ContentFields.Count
is 0
What would be the recommended way of parsing this bugreport?
Update_1:
It seems that the TMultipartContentParser seems to correctly parse all files (application/octet-stream
) but leaves the plaintext unparsed.