I am trying to send data which will appear in this form:
{
    "id": ,
    "venue": {
        "id": ,
        "name": "",
        "city": "",
        "address": "",
        "rating": null,
        "point": null
    },
    "name": "",
    "time": "",
    "event_pic": null,
    "description": "",
    "event_type": "Movie",
    "invite_only": ,
    "free": ,
    "age_restriction": ,
    "ticket_price": ,
    "user": 
}
I have made the interface like this using retrofit:
 @Multipart
    @POST("api/events/")
    Observable<Event> postEvent(
            @Part("venue") Venue venue,
            @Part("event_pic") RequestBody image,
            @Part("name") RequestBody name,
            @Part("description") RequestBody description,
            @Part("time") RequestBody date,
            @Part("event_type") RequestBody type,
            @Part("invite_only") RequestBody isInviteOnly,
            @Part("age_restriction") RequestBody isAgeRestricted,
            @Part("free") RequestBody isFree,
            @Part("ticket_price") RequestBody ticketPrice
    );
And it is posted using rxjava like this:
public void postEvent() {
        postEventUseCase.setAgeRestricted(ageRestricted);
        postEventUseCase.setDate(date);
        postEventUseCase.setFree(free);
        postEventUseCase.setInviteOnly(inviteOnly);
        postEventUseCase.setDescription(description);
        postEventUseCase.setName(name);
        postEventUseCase.setPath(path);
        postEventUseCase.setTicketprice(ticketprice);
        postEventUseCase.setType(type);
        postEventUseCase.setVenue(venue);
        subscription = postEventUseCase.execute().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe();
    }
However when I try to post it I get this error: 02-14 16:21:26.468 7133-7762/com.wyat.wyat D/OkHttp: <-- 400 Bad
Request http://zacmwa.pythonanywhere.com/api/events/ (7417ms)
    02-14 16:21:26.468 7133-7762/com.wyat.wyat D/OkHttp: Server: openresty/1.9.15.1
    02-14 16:21:26.468 7133-7762/com.wyat.wyat D/OkHttp: Date: Tue, 14 Feb 2017 13:21:26 GMT
    02-14 16:21:26.468 7133-7762/com.wyat.wyat D/OkHttp: Content-Type: application/json
    02-14 16:21:26.468 7133-7762/com.wyat.wyat D/OkHttp: Transfer-Encoding: chunked
    02-14 16:21:26.468 7133-7762/com.wyat.wyat D/OkHttp: Connection: keep-alive
    02-14 16:21:26.468 7133-7762/com.wyat.wyat D/OkHttp: Vary: Accept
    02-14 16:21:26.468 7133-7762/com.wyat.wyat D/OkHttp: X-Frame-Options: SAMEORIGIN
    02-14 16:21:26.468 7133-7762/com.wyat.wyat D/OkHttp: Allow: GET, POST, OPTIONS
    02-14 16:21:26.468 7133-7762/com.wyat.wyat D/OkHttp: {"venue":["This field is required."]}
    02-14 16:21:26.468 7133-7762/com.wyat.wyat D/OkHttp: <-- END HTTP (37-byte body)
EDIT:
However logging shows that the venue is created:
 02-14 16:21:18.620 7133-7762/com.wyat.wyat D/OkHttp: Content-  Disposition: form-data; name="venue"
02-14 16:21:18.620 7133-7762/com.wyat.wyat D/OkHttp: Content-Transfer-Encoding: binary
02-14 16:21:18.620 7133-7762/com.wyat.wyat D/OkHttp: Content-Type: application/json; charset=UTF-8
02-14 16:21:18.620 7133-7762/com.wyat.wyat D/OkHttp: Content-Length: 59
02-14 16:21:18.620 7133-7762/com.wyat.wyat D/OkHttp: {"address":"ersysaj","city":"ahgsagya","name":"hdyfjfnfjf"}
How do I post the data? I have done it successfully with other means so I know that the problem is not on the backend. What is causing the error?
The venue POJO is like this:
public class Venue {
    @SerializedName("name")
    @Expose
    private String name;
    @SerializedName("city")
    @Expose
    private String city;
    @SerializedName("address")
    @Expose
    private String address;
    @SerializedName("rating")
    @Expose
    private Double rating;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Venue withName(String name) {
        this.name = name;
        return this;
    }
    public String getCity() {
        return city;
    }
    public void setCity(String city) {
        this.city = city;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public double getRating() {
        return rating;
    }
    public void setRating(double rating) {
        this.rating = rating;
    }
}
 
     
    