jsongethttp-content-length

Is there a way to pass big json string in get request?


I have a big json string that I need to pass as string in get request but I get 404.

example data:

var result = {data: [{
        firstname: "Name1", surname: "Surname 1", birthdate: new Date(), classname: "Class 1", classid: "1", grade: "1", studentid: "1", results: [
                { ResultID: '1', StudentID:"1", ClassID:"118", YearID:"23", assessmentId:"49", Term:"0", Month:"0", Week:"0", Semester:"1", NotesLong:null, Color:"FF8080", AllowNumber:"true", ResultValue: '45.0', AssessmentName: "assessment 1", YearTermSemester: "2016 S1", shortdescription: "level", MaxLength: 2000, MapDetailId: 933, ResultTypeID: 44 },
                { ResultID: '41', StudentID: "1", ClassID: "118", YearID: "23", assessmentId: "49", Term: "0", Month: "0", Week: "0", Semester: "1", NotesLong: null, Color: "FF8080", AllowNumber: "true", ResultValue: 'Fiction', AssessmentName: "assessment 1", YearTermSemester: "2016 S1", shortdescription: "x-level", MaxLength: 'Select from list', MapDetailId: 933, ResultTypeID: 45 },
        { ResultID: '43', StudentID: "1", ClassID: "118", YearID: "23", assessmentId: "10", Term: "0", Month: "0", Week: "0", Semester: "2", NotesLong: null, Color: "FF8080", AllowNumber: "true", ResultValue: '73', AssessmentName: "assessment 2", YearTermSemester: "2016 S2", shortdescription: "y-level", MaxLength: 2000, MapDetailId: 934, ResultTypeID: 2 },
        { ResultID: '50', StudentID: "1", ClassID: "118", YearID: "24", assessmentId: "2", Term: "0", Month: "0", Week: "0", Semester: "2", NotesLong: null, Color: "FF8080", AllowNumber: "true", ResultValue: '60.5', AssessmentName: "assessment 3", YearTermSemester: "2017 S2", shortdescription: "z-level", MaxLength: 2000, MapDetailId: 935, ResultTypeID: 2 },
        { ResultID: '51', StudentID: "1", ClassID: "118", YearID: "23", assessmentId: "4", Term: "0", Month: "0", Week: "0", Semester: "2", NotesLong: null, Color: "FF8080", AllowNumber: "true", ResultValue: '56.58', AssessmentName: "assessment 4", YearTermSemester: "2016 S2", shortdescription: "q-level", MaxLength: 2000, MapDetailId: 936, ResultTypeID: 2 }]
    }]
};

Is there a way to achieve this? (I cant use post..)


Solution

  • Http get request is sent params in the URL. And the length of a URL is limited (maximum URL length is 2048 characters).

    You can sent a post request with this params and save it on server side as some filter, server will return a filter_id. Then you sent a get request with this filter_id.