parse.comのusersテーブルにユーザーデータを投稿しようとすると、BadRequestErrorが発生します。このコードの何が問題になっていますか?任意のヘルプPlz。これが私のコードです
if form.is_valid(): # All validation rules pass
username = form.cleaned_data['username']
name = form.cleaned_data['name']
password1 = form.cleaned_data['password1']
password2 = form.cleaned_data['password2']
email = form.cleaned_data['email']
data = {"username": username, "name": name, "password": password1, "email": email}
data = urllib.urlencode(data)
url = settings.API_USER_ROOT
http_verb = 'POST'
request = urllib2.Request(url, data)
request.add_header('Content-type', 'application/json')
auth_header = "Basic %s" % base64.b64encode('%s:%s' % (settings.APPLICATION_ID, settings.MASTER_KEY))
request.add_header("Authorization", auth_header)
request.get_method = lambda: http_verb
try:
print '***************'
response = urllib2.urlopen(request)
print '***********'
except urllib2.URLError, e:
print e.reason