Getting [general-trigger-rest] - REST Trigger Error: eval expression failed invalid character '-' in numeric literal while posting 'multipart form-data'
book
Article ID: KB0077714
calendar_today
Updated On:
Products
Versions
TIBCO Flogo Enterprise
2.x.x
Description
When you are using the existing ReceiveHTTPMessage HTTP trigger activity as a rest trigger and want to post the 'multipart-form-data' to the service, you will end-up with getting above mentioned error in console logs.
Issue/Introduction
When you are using the existing ReceiveHTTPMessage HTTP trigger activity as a rest trigger and want to post the 'multipart-form-data' to the service, you will end-up with getting above mentioned error in console logs.
Environment
All
Resolution
The rest trigger (ReceiveHTTPMessage) activity that used in the flow is not meant to use for posting 'multipart-form-data'. Go-Json-Rest is a framework for REST APIs using JSON as a representation format, not form encoded nor URL encoded content. The payload of the post request must be JSON and the Content-Type header "application/json". Please refer to the below article which will give you an in-depth details of what is going wrong: https://github.com/ant0ine/go-json-rest/issues/94
To overcome and achieve the requirement of posting 'multipart form-date' one can create their custom ReST/HTTP trigger or leverage the already available OSS trigger from community. You can use below HTTP/ReST trigger for your requirement: https://github.com/project-flogo/contrib/tree/master/trigger/rest