elsa-workflows / elsa-workflows/elsa-core

FormUrlEncoded strings are not parsed correctly ending up with an error parsing as JSON is expected

Open
#6,513 0 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

I ran into an issue with the HTTPRequest activity. I am trying to send a formurlencoded string to an endpoint. The Error I am getting is that the string I passed in, cannot be parsed as JSON.

![Image](https://github.com/user-attachments/assets/34de7b48-f015-40a4-ad0e-9478cb764f79)

I then looked into the code and in Elsa.Http/ContentWriters/FormUrlEncodedHttpContentFactory.cs on approx line 23, the issue is originated.

I changed that line so that there is a split between string and object, and when it is string, I created another static function to split on "&" and then on "=" and fed these into the dictionary which works.

I am unfortunately not able to post this change back to the source, so I am reporting it as a bug, hoping it will be fixed in an upcoming release of Elsa, if you consider this a bug too.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.