Closed xmh0511 closed 7 years ago
You seem to be missing the Content-Lenght header field?
thank you,I have solved this problem
code: try {
auto ifs = make_shared
ifs->seekg(0, ios::beg);
*response << "HTTP/1.1 200 OK\r\nContent-Length: " << length <<"\r\nAccess-Control-Allow-Origin:*Content-Type:application/x-jpg"<< "\r\n\r\n";
default_resource_send(server, response, ifs);
}
}catch(const exception &e){
}
Hi,I want to make my server return the image stream ,I just write the code like this:"stringstream buf; buf << request->content.rdbuf(); response << "HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin:\r\nContent-Type:application/x-jpg" << "\r\n\r\n"<<buf.str();" but it's not work,thanks for giving me some help