RetrofitError:零件主体不能为空

时间:2015-08-03 05:05:23

标签: android api retrofit

我正在进行这次改装api通话。我得到零件体的改造错误不能为空。请帮忙。我检查了域名。我还有一个'获得',但它工作正常

Java代码

TypedString role = new TypedString("both");
            int fbRegisterFlag = 0;
            TypedString firstName = new TypedString("Saurabh");
            TypedString lastName = new TypedString("Lahoti");
            TypedString password = new TypedString("saurabh");
            TypedString email = new TypedString("saurabh@clicklabs.edu");
            TypedString mobile = new TypedString("9650076366");
            TypedString college = new TypedString("DTU");
            TypedString bioDescription = new TypedString("DTU");
            TypedString[] transcripts = {new TypedString("saurabh"), new TypedString("lahoti")};
            int year = 2011;
            TypedString[] majors = {new TypedString("saurabh"), new TypedString("lahoti")};
            TypedString[] minors = {new TypedString("saurabh"), new TypedString("lahoti")};
            int[] availability = {1, 2, 3};

            webServices.register(role, firstName, lastName, fbRegisterFlag, password, new TypedString("gsdf"), new TypedString("sdfsdf"),
                    college, year, email, new TypedString("sdfsdf"), mobile, majors, minors, bioDescription, transcripts, 0, availability, majors, new Callback<String>() {

                        @Override
                        public void success(String s, Response response) {

                        }

                        @Override
                        public void failure(RetrofitError error) {

                        }
                    });

改造界面

public interface WebServices {
@Multipart
@POST("/api/user/signup")
void register(@Part("role") TypedString role,
              @Part("firstName") TypedString firstName,
              @Part("lastName") TypedString lastName,
              @Part("fbRegisterFlag") int fbFlag,
              @Part("password") TypedString password,
              @Part("fbId") TypedString fbId,
              @Part("profilePicture")TypedString profile,
              @Part("college") TypedString college,
              @Part("year") int year,
              @Part("primaryEmail") TypedString primaryEmail,
              @Part("facebookEmail") TypedString fbEmail,
              @Part("mobileNumber") TypedString mobnumber,
              @Part("majors") TypedString [] majors,
              @Part("minors") TypedString [] minors,
              @Part("bioDescription") TypedString bio,
              @Part("transcripts") TypedString [] transcripts,
              @Part("fee") int fee,
              @Part("availability") int [] availability,
              @Part("courses") TypedString [] courses,
              Callback <String> callback);
             }

0 个答案:

没有答案