System.ArgumentException,使用InvokeApiAsync()

时间:2016-02-01 05:28:13

标签: c# azure argumentexception

尝试将一些参数传递给在azure移动服务上运行的自定义API,使用List引用和Object作为参数发送。然后我面临此错误。

  

无法确定App7.DataModels.FriendCircle类型的JSON对象类型。

FriendCircle friendcircle = new FriendCircle();
List<Invitee> inviteelist;
try
{

    Object[] ob = new Object[2] { friendcircle, inviteelist };
    await App.azure_rendezvous_mobile_service_3Client.InvokeApiAsync("saveinvite", new JObject(new JProperty("params", ob)));

} 
catch (MobileServiceInvalidOperationException ex) 
{
    System.Diagnostics.Debug.WriteLine("Exception is :" + ex.Message);

}

1 个答案:

答案 0 :(得分:1)

我试过并且能够向azure自定义api发送请求。!! 将我的List参考和对象朋友圈序列化为Json并将其作为Json Properties连接起来。

import pygame
import os

w = pygame.display.set_mode((300,300))

bug = os.path.join("/Users/Snyman/Desktop/images/double-block_spm_R.png")
bug = pygame.image.load(bug).convert_alpha()
bug = pygame.transform.scale(bug,(64,64))

loop = True

while loop:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            loop = False

    w.fill((255,255,255))
    w.blit(bug,(10,10))
    pygame.display.update()

pygame.quit()

P.S安装包&gt;&gt;来自NuGet经理的Newtonsoft.Json并将其作为参考。

相关问题