Skip to content

Commit

Permalink
fix(discovery-v2): add enrichment to the form-data
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkowa committed Jun 16, 2021
1 parent f83b6ad commit acfd7b5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Scripts/Services/Discovery/V2/DiscoveryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2202,6 +2202,11 @@ public bool CreateEnrichment(Callback<Enrichment> callback, string projectId, Cr
}

req.Forms = new Dictionary<string, RESTConnector.Form>();
if (enrichment != null)
{
byte[] byteArray = Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(enrichment));
req.Forms["enrichment"] = new RESTConnector.Form(new System.IO.MemoryStream(byteArray), "" ,"application/json");
}
if (file != null)
{
req.Forms["file"] = new RESTConnector.Form(file, "filename", "application/octet-stream");
Expand Down

0 comments on commit acfd7b5

Please sign in to comment.