We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I'm trying to send JSON docs to SOLR with this package, but somehow I can't make it work. Here is my code:
string SOLRInsert = "http://192.168.x.x:8985/solr/test/update"; byte[] dataBytes = Encoding.ASCII.GetBytes("{\"add\":{\"commitWithin\":10000, \"doc\":" + json.ToString() + "}}"); Curl.GlobalInit((int)CURLinitFlag.CURL_GLOBAL_ALL); Easy easy = new Easy(); Easy.WriteFunction wf = new Easy.WriteFunction(OnWriteData); easy.SetOpt(CURLoption.CURLOPT_WRITEFUNCTION, wf); easy.SetOpt(CURLoption.CURLOPT_POST, true); easy.SetOpt(CURLoption.CURLOPT_HTTPHEADER, "Content-Type:application/json"); easy.SetOpt(CURLoption.CURLOPT_POSTFIELDS, dataBytes); //easy.SetOpt(CURLoption.CURLOPT_POSTFIELDSIZE, dataBytes.Length); easy.SetOpt(CURLoption.CURLOPT_URL, SOLRInsert); easy.Perform(); easy.Dispose(); Curl.GlobalCleanup();
the write function: public static Int32 OnWriteData(Byte[] buf, Int32 size, Int32 nmemb, Object extraData) { Console.Write(System.Text.Encoding.UTF8.GetString(buf)); return size * nmemb; }
public static Int32 OnWriteData(Byte[] buf, Int32 size, Int32 nmemb, Object extraData) { Console.Write(System.Text.Encoding.UTF8.GetString(buf)); return size * nmemb; }
The SOLR gives the following error message
missing content stream
If someone could point at my problem, I would be most grateful.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I'm trying to send JSON docs to SOLR with this package, but somehow I can't make it work.
Here is my code:
the write function:
public static Int32 OnWriteData(Byte[] buf, Int32 size, Int32 nmemb, Object extraData) { Console.Write(System.Text.Encoding.UTF8.GetString(buf)); return size * nmemb; }
The SOLR gives the following error message
If someone could point at my problem, I would be most grateful.
The text was updated successfully, but these errors were encountered: