I am editing the tags of a question via the API, and to do that you have to pass the body and title etc.
I can get the Markdown or HTML from the API but I can't see how to send it back formatted properly.
These revisions pretty much show what I've tried:
\n\r
. Didn't work (rev 4).<br><br>
, as given by the API Markdown. Didn't work (rev 6).<p>...</p>
, as given by the API HTML. Works (rev 8), but boy does that question Markdown look ugly.designed%20for%20the%20following%20
- URL encode. Didn't work (rev 9).%0A%0A
replacing\n\r
. Didn't work (rev 12).
So how do I edit it neatly?
Even direct copy / paste from the source page into the body box gives bad results.
\r\n
and the string should have the hex bytes 0x0D, 0x0A (before form encoding). Make sure you escape (or don't) the `\`s properly for whatever language you are using.\\\r\\\\n
instead?%0D%0A
bits. If it has%250D%250A
, you're miss/over encoding. What language are you using? For most languages, it's just\r\n
in a plain ASCII string.\r\n
works perfectly!