TypeError:不是有效的非字符串序列或映射对象 •构造了数据字典并使用了json.dumps •发布请求和数据
LinearLayoutManager linearLayoutManager = new LinearLayoutManager( getActivity() );
linearLayoutManager.setOrientation( LinearLayoutManager.VERTICAL );
linearLayoutManager.setAutoMeasureEnabled( true );
邮政请求方法(这不是完整的代码,只是执行邮件请求的部分)
data = {
"filter": "'{{Activity.Type}}'='Bounceback'",
"name": "Bulk Activity Export - Bounceback",
"fields": {
"ActivityId": "{{Activity.Id}}"
}
}
data = json.dumps(data)
print(request.post("/activities/exports", data = data ))
结果:
身份验证没有问题。这是请求对象和http标头。我得到TypeError:不是有效的非字符串序列或映射对象错误。
def post(self, url, data):
return self.request('POST', url, data)
print(request)
if data != None:
data = urllib.urlencode(data)
标题:
data object: {"filter": "'{{Activity.Type}}'='Bounceback'", "fields": {"AssetType": "{{Activity.Asset.Type}}", "ActivityId": "{{Activity.Id}}", "EmailAddress": "{{Activity.Field(EmailAddress)}}", "AssetId": "{{Activity.Asset.Id}}", "ActivityDate": "{{Activity.CreatedAt}}", "AssetName": "{{Activity.Asset.Name}}", "CampaignId": "{{Activity.Campaign.Id}}", "ExternalId": "{{Activity.ExternalId}}", "ActivityType": "{{Activity.Type}}"}, "name": "Bulk Activity Export - Bounceback"}