java - How do I POST a collection objects(with scaler attributes) using with Retrofit -


I use "rate build" with interface methods such as java "collections" or "array list" argument Have tried, but always end with 400 or 500 type errors

  Interface in method SvcApi @ POST (PATIENT_MEDSTAKEN + "/ {patientID}") Public Boolean submitMedsTaken (@Body ArrayList. & Lt; MedicationTaken & gt; medstaken; @ path ("patient ID") long ID); Build APIs by: Private SvcApi symptomManagementService = New RestAdapter.Builder () .setEndpoint (TEST_URL) .setLogLevel (LogLevel.FULL) .build () .create (SvcApi.class);  

Result:

  Detect JUnit failure: retrofit.RetrofitError: 500 server error  

Eclipse Console:

  ---> HTTP POST http://10.0.0.5:8080/patient/medicationstaken/1 Content-Type: Applications / Jason; Charset = UTF-8 content-length: 63 [["ID": 0, "taken": true, "timeTank": 1415132592031, "checkin id": 2}] ---> end http (63-byte body) ) & Lt; --- HTTP 500 http: // localhost: 8080 / patient / medicationstaken / 1 (35ms): HTTP / 1.1 500 server error content-language: en-US content-length: 501 content type: text / html; Charset = ISO-8859-1X Application-context: Application Server: Jetty (8.1.14.v20131031)  


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -