How do I apply such type of a post data?

Hello everyone
While I’m making a config I confronted this type of post data where there is double of this variable symbol “<>” and the intern one should contain the variable and the external should remain as it is but if I put both of them I face this error as shown in the following screenshot. any help is very appreciated

image

Hey, if you need to send a literal < character then I suggest you follow what I said in this other post

1 Like

Appreciate it, but the Content Type I’m dealing with is in this form if you missed it on the picture “application/vnd.ui.trinity.minimalmailmessage+json”
Will this work as an XML Type?

No no I just mean that you have to build the string interpolating it using C# syntax as in the other example, I don’t mean that yours is XML ^^ just use it as a reference to build the string using standard C# interpolation.

Example:

string interp = $"this is a C# interpolated string {variable} and you can use these without problems << >>";

then plug the interp variable into the post data and voilà

1 Like

The thing is those two symbols <<>> remains only one of them which is the external one and the internal will disappear when the variable is detected/recognized so it would be like this <VARIABLE> when it is processed in the The Post Data.

I think you’re either not reading what I write or you are not understanding…
If you interpolate variables directly with C# you use {curlybraces} to interpolate, not <anglebraces> so basically you are able to do this <{input.USER}> and it will correctly print the characters.

1 Like

No, I read everything in the other post, I think I haven’t clearly understand how do I put the Post Data using LoliCode or C#

See the example

string toPost = $"This is my <{input.USERNAME}> wrapped in < these >";

BLOCK:HttpRequest
  url = "https://httpbin.org/anything"
  TYPE:STANDARD
  @toPost
  "application/x-www-form-urlencoded"
ENDBLOCK

I’m completely lost :sweat_smile: This is my Post Data I hope you can fix it

{"mailHeader":{"from":"\"<USER>\" <<USER>>","to":["\"\" <<TOUSER>>"],"cc":[],"bcc":[],"subject":"Test","date":<TIME>879,"priority":"3"},"htmlBody":"<html><body>Test from STRANGER</body></html>","attachments":[]}

Hey listen if you cannot understand then open an issue on github asking to implement a way to escape the < character, if there isn’t an issue like that already, sorry but I don’t have the time to help more.

Appreciate your assistance, thank you for your time.

I have another idea which is faster, just use 2 constant string blocks and use those in the interpolation like this (you need to paste this code in the LoliCode tab of the program!!!)

BLOCK:ConstantString
LABEL:<
  value = "<"
  => VAR @LA
ENDBLOCK

BLOCK:ConstantString
LABEL:>
  value = ">"
  => VAR @RA
ENDBLOCK

BLOCK:HttpRequest
  url = "https://httpbin.org/anything"
  TYPE:STANDARD
  $"{\"mailHeader\":{\"from\":\"\\\"<USER>\\\" <LA><USER><RA>\",\"to\":[\"\\\"\\\" <LA><TOUSER><RA>\"],\"cc\":[],\"bcc\":[],\"subject\":\"Test\",\"date\":<TIME>879,\"priority\":\"3\"},\"htmlBody\":\"<LA>html<RA><LA>body<RA>Test from STRANGER<LA>/body<RA><LA>/html<RA>\",\"attachments\":[]}"
  "application/x-www-form-urlencoded"
ENDBLOCK
1 Like

This one did the job perfectly, I really didn’t think about trying such idea though it is easy but never popped up in my mind lol
Thank you so much Ruri you’ve been very helpful :blue_heart:

image

1 Like