Frapper qiita api avec le code python ci-dessous renvoie l'erreur "Les balises doivent être un tableau de has hess."
{"error":"Tags must be an array of hashes."}
# -*- coding:utf-8 -*-
import urllib
reqdata = {}
reqdata['title'] = 'qiita first post'
reqdata['tags'] = [{'name':'qiita'}]
reqdata['body'] = 'first post'
reqdata['private'] = 0
reqdata['twitter'] = 0
reqdata['token'] = TOKEN
params = urllib.urlencode(reqdata)
url = 'https://qiita.com/api/v1/items'
print urllib.urlopen(url,params).read()#Maintenant POST
print url+params
body=first+post&tags=[{'name':+'qiita'}]&twitter=0&title=qiita+first+post&private=0&token=TOKEN
body=first post&tags=[{'name': 'qiita'}]&twitter=0&title=qiita first post&private=0&token=TOKEN
Recommended Posts