Expected BEGIN OBJECT but was BEGIN ARRAY at line 1 column 63 path data

0 votes
Here i am using retrofit post request:-


RequestBody name = RequestBody.create(MediaType.parse("text/plain"), et_Name.getText().toString());
RequestBody shop = RequestBody.create(MediaType.parse("text/plain"), et_Name.getText().toString());
RequestBody shopreg = RequestBody.create(MediaType.parse("text/plain"), et_Name.getText().toString());
RequestBody gst = RequestBody.create(MediaType.parse("text/plain"), et_Name.getText().toString());
RequestBody pan = RequestBody.create(MediaType.parse("text/plain"), et_Name.getText().toString());
RequestBody phone = RequestBody.create(MediaType.parse("text/plain"), et_Name.getText().toString());
RequestBody userid = RequestBody.create(MediaType.parse("text/plain"), "78");
Map<String, RequestBody> data = new HashMap<>(); //full_name, shop_name,  shop_reg_no, gst_no, pan_no, user_id, phone_no
data.put("user_id", userid);
data.put("full_name", name);
data.put("shop_name",shop);
data.put("shop_reg_no", shopreg);
data.put("gst_no",gst);  //22AAAAA0000A1Z5
data.put("pan_no", pan);  //AAAPL1234C
data.put("phone_no", phone);
RetrofitInterface jsonpost = ServiceGenerator.createService(RetrofitInterface.class,"https://www.edureka.co/");
Call<Registration_Repo> call = (Call<Registration_Repo>) jsonpost.post(data);
call.enqueue(new Callback<Registration_Repo>() {
    @Override
    public void onResponse(Call<Registration_Repo> call, retrofit2.Response<Registration_Repo> response) {
        if (response.isSuccessful()){
            assert response.body() != null;
            String name = response.body().getData().getFull_name();
Apr 24, 2020 in Java by anonymous
• 120 points
2,684 views
Hey, @Vickey,

Could you please post your object class, what you are using?

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Java

0 votes
1 answer

GSON throwing “Expected BEGIN_OBJECT but was BEGIN_ARRAY”?

This will work: ChannelSearchEnum[] enums = gson.fromJson(yourJson, ChannelSearchEnum[].class); But ...READ MORE

answered Dec 26, 2018 in Java by Sushmita
• 6,920 points
28,574 views
0 votes
1 answer

Following error is occurring "Can't start Eclipse - Java was started but returned exit code=13"

There are combinations of Operating System, JDK ...READ MORE

answered Apr 19, 2018 in Java by Rishabh
• 3,620 points
2,977 views
+1 vote
1 answer

how to print this statement in java print(' '*(r-x-1)+'*'*(2*x+1)) ( logic used in python .its perfect) but java wrong output came

In ' '*(r-x-1) and '*'*(2*x+1), you used multiplication ...READ MORE

answered Dec 22, 2019 in Java by Utsab Bandyopadhyay
1,141 views
0 votes
1 answer

Error:The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

Hello @kartik, Include servlet-api-3.1.jar in your dependencies. Maven <dependency> ...READ MORE

answered Jun 3, 2020 in Java by Niroj
• 82,840 points
4,299 views
0 votes
0 answers

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path [duplicate]

I have a project created by Maven ...READ MORE

Apr 21, 2022 in Java by Rahul
• 3,380 points
1,576 views
0 votes
2 answers

One line initialization of an ArrayList object in Java

In Java 8 or earlier: List<String> string = ...READ MORE

answered Jul 26, 2018 in Java by samarth295
• 2,220 points
4,757 views
0 votes
1 answer

How can we get the current location in Android?

First you need to define a LocationListener to handle ...READ MORE

answered Sep 25, 2018 in Java by Parth
• 4,640 points
921 views
0 votes
1 answer

Can't find class CognitoUserPoolsSignInProvider: Issue with Sign In integration

CognitoUserPoolsSignInProvider is ditributed as part of aws-android-sdk-auth-userpools library. Please import ...READ MORE

answered Sep 28, 2018 in AWS by Priyaj
• 58,020 points
930 views
0 votes
1 answer

How to Read/Write String from a File in Android

Writing a File in android: private void writeToFile(String ...READ MORE

answered Oct 3, 2018 in Java by sharth
• 3,370 points
7,366 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP