Carbon-API icon indicating copy to clipboard operation
Carbon-API copied to clipboard

Cant use new line in the first method

Open crackedpotato007 opened this issue 4 years ago • 4 comments

The code can be only one line in the first method

crackedpotato007 avatar Feb 25 '21 14:02 crackedpotato007

I can't use newlines in any method GET or POST.

Any request with newlines in the code field just has them be gone, resulting in a LONG one-line string of text.

ariscript avatar May 07 '21 16:05 ariscript

Ideally it should follow the same syntax as url encoding does. So suppose this is a request for code to be in one line https://carbonnowsh.herokuapp.com/?code=This%20is%20one%20line

Replacing %20 with %250A should shift it to a new line https://carbonnowsh.herokuapp.com/?code=This%20is%250Anext%20line

Will try to encode and push changes to the API to handle such scenarios

cyberboysumanjay avatar May 07 '21 16:05 cyberboysumanjay

Seems to work with it URI encoded. Didn't think that I had to do that in the case of sending a POST request because JSON can handle any string thrown at it.

ariscript avatar May 08 '21 14:05 ariscript

"This is%0Anext line" in post request %0A - is \n

Asliddin750750 avatar Oct 11 '22 18:10 Asliddin750750