How to convert this curl command in c#?

Convert command line cURL to C cURL

  • I've never done any curl before so am in need of some help. I've tried to work this out from examples but cannot get my head around it! I have a curl command that I can successfully run from a windows command line that index pdf file in Solr. I would need to incorporate this curl command in a C clinet. How can I translate this curl command so that it works in a C cURL client? curl "http://localhost:8983/solr/update/extract?literal.id=doc2&uprefix=attr_&fmap.content=attr_content&commit=true"" -F "[email protected]"

  • Answer:

    STARTUPINFO si = { sizeof(STARTUPINFO) }; PROCESS_INFORMATION pi; TCHAR tempCmdLine[MAX_PATH]; _tcscpy_s(tempCmdLine, MAX_PATH, _T("curl.exe http://localhost:8983/solr/update/extract?literal.id=doc2&uprefix=attr_&fmap.content=attr_content&commit=true -F [email protected]")); CreateProcess(NULL, tempCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); You may want to check the return value of CreateProcess.

prasad at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.