-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTPError: 422 Client Error: Unprocessable Entity for url when Creating a Topic #9
Comments
Please share the code you're using to generate this topic, and the full traceback. I can't tell what's going on with the information presented. |
Dear @samamorgan try:
mytopic = client.create_topic(
title=topic_title,
raw=topic_content,
category=topic_category_id,
created_at=topic_time
)
time.sleep(1)
comments = item.topic_replies
for item2 in comments:
com_content = item2.reply_content
com_usr = item2.reply_user
com_time = item2.reply_time
client.create_post(
topic_id=mytopic.topic_id,
raw=com_content
created_at=com_time
)
time.sleep(1)
except:
print('detect one problem') In some cases it is going the exception section. When I check it, it returns that problem. I think maybe the URL is very long, but I don't know how to reduce it. (Maybe this could help us) |
What's the full traceback? Have you tried printing out the return message? I'd expect the API to return a useful message of some sort in addition to the URL. This library is built on Requests, so you can simply inspect the I'd also suggest creating a topic with the bare-minimum amount of information as a first test, then slowly add more information until you hit a break. If you can find out more about what is causing this, this library can address it (or not, depending on the cause). |
Thanks @samamorgan |
I think when the topic content is so long, it occurs. But, my question is that, why it post to posts.json likes as GET method? |
Hi, I want to add some topics but the exception is occurring
The text was updated successfully, but these errors were encountered: