The documentation for the edit question method (/questions/{id}/edit
) is somewhat vague.
Are all of the parameters required?
For example, if the only field I want to change in the question is tags
, do I still have to provide title
and body
?
(It seems like I may have to, but that seems incredibly inefficient so I assume that I'm misunderstanding something?)
Edit:
When providing the body should it be with or without markdown, and safe or unsafe?
Should I replace Escape Codes like
\n
/\r
/\t
with ASCII characters (10/13/9) before sending the body back with the edit? What about HTML Entity codes
An example of an issue is this:
"...End Sub \r\n\r\n\r\nShould..."
...becomes this:
"...End Sub \\r\\n\\r\\n\\r\\nShould..."
...after passing through my process; I've tried several variations.
Related Questions:
- How do I add newlines when editing a post body via the API?
- How to quickly retag a question from the API? (No answers)
- Should HTML or Markdown be passed to /questions/{id}/edit?
I would have assumed there was a way to indicate "no changes to this field", with a zero length string or a specific symbol, to avoid issues like this; having to deal with markdown conversion and such, when all I want to do is add or remove a tag.
body
takes markdown or the allowed HTML that posts can have. As for Chinese or Emojis, you'll have to test that. My guess is that if it's not UTF8, then it gets stripped or mangled.body_markdown
as you suggested, but both safe or unsafe "mess up the body"no_change
flag, but there isn't.