MCPcopy Create free account
hub / github.com/catboost/catboost / SendMinimalHttpRequest

Function SendMinimalHttpRequest

library/cpp/http/io/stream.cpp:972–998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

970}
971
972void SendMinimalHttpRequest(TSocket& s, const TStringBuf& host, const TStringBuf& request, const TStringBuf& agent, const TStringBuf& from) {
973 TSocketOutput so(s);
974 THttpOutput output(&so);
975
976 output.EnableKeepAlive(false);
977 output.EnableCompression(false);
978
979 const IOutputStream::TPart parts[] = {
980 IOutputStream::TPart(TStringBuf("GET ")),
981 IOutputStream::TPart(request),
982 IOutputStream::TPart(TStringBuf(" HTTP/1.1")),
983 IOutputStream::TPart::CrLf(),
984 IOutputStream::TPart(TStringBuf("Host: ")),
985 IOutputStream::TPart(host),
986 IOutputStream::TPart::CrLf(),
987 IOutputStream::TPart(TStringBuf("User-Agent: ")),
988 IOutputStream::TPart(agent),
989 IOutputStream::TPart::CrLf(),
990 IOutputStream::TPart(TStringBuf("From: ")),
991 IOutputStream::TPart(from),
992 IOutputStream::TPart::CrLf(),
993 IOutputStream::TPart::CrLf(),
994 };
995
996 output.Write(parts, sizeof(parts) / sizeof(*parts));
997 output.Finish();
998}
999
1000TArrayRef<const TStringBuf> SupportedCodings() {
1001 return TCompressionCodecFactory::Instance().GetBestCodecs();

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 5

TPartClass · 0.85
EnableKeepAliveMethod · 0.45
EnableCompressionMethod · 0.45
WriteMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected