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.khaokamao.in/");
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 23 in Java by anonymous
• 120 points
146 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,890 points
14,777 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,580 points
1,298 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 21, 2019 in Java by Utsab Bandyopadhyay
201 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 3 days ago in Java by Niroj
• 23,950 points
22 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,190 points
847 views
0 votes
2 answers

How can I create File and write data in it using Java?

import java.io.BufferedWriter; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; public class WriteFiles{ ...READ MORE

answered Jul 26, 2018 in Java by samarth295
• 2,190 points
230 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
113 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
• 57,530 points
130 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
1,949 views