我有一个很大的json字符串,我需要在get请求中作为字符串传递,但我得到404。
示例数据:
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 }]
}]
};
有没有办法实现这个目标? (我不能使用帖子..)
答案 0 :(得分:0)
Http get请求在URL中发送了params。并且URL的长度是有限的(最大URL长度为2048个字符)。
您可以使用此参数发送一个帖子请求并将其保存在服务器端,因为某些过滤器,服务器将返回filter_id。然后你用这个filter_id发送了一个get请求。