Go REST
M

PUT request body for posts endpoint

Misterios Person over 2 years ago 3352 views 2 replies

i tried this but it didn't work. can anyone help?

{
id: 69255,
user_id: 5166222,
title: This Side of Paradise,
body: Off with his head!
}

2 replies
Z
zeevy over 2 years ago

What is the error your are getting. Can you provide the sample code that you are using

P
Pariya Samy over 2 years ago

Failed to create user post. Status code:422

TypeError Traceback (most recent call last)
Cell In[41], line 37
35 print(Failed to create user post. Status code:422)
36 try:
---> 37 error_messages = response.json()['errors']
38 for i in range(len(error_messages)):
39 print(fError message {i + 1}: {error_messages[i]})

TypeError: list indices must be integers or slices, not str

Your reply

Markdown supported