Skip to main content
4 of 4
Organized for clarity.
Brock Adams
  • 13k
  • 5
  • 39
  • 64

The \r\n issue was solved when I changed to a POST request.

But, since I was retagging questions (didn't really need to change the body, just resend it), I ended up using the body_markdown, encoded with HTMLParser.HTMLParser().unescape()

body_markdown = str(HTMLParser.HTMLParser().unescape(question_data['items'][0]['body_markdown']))

<%%>

And then sending it with:

response = requests.post('https://api.stackexchange.com/2.2/questions/'+str(q_id)+'/edit',
      data={'body': body_markdown,
            'comment': 'removed '+tag+' tag',
            'tags': ' '.join(tags),
            'title': title,
            'access_token': token,
            'site': site,
            'key': key
            }
        )
Tim
  • 581
  • 2
  • 11