Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to put and delete request to The Website.The website backstage control by java.the java's put or delete has params 'key' and 'values'.what format i need to pass to.for example the key is 'a' value is 'b'.if I want to delete it,I should pass what int func curl_easy_setopt(curl, CURLOPT_WRITEDATA, ???);
Posted
Comments
pasztorpisti 28-Aug-13 9:01am    
I have already used libcurl in C/C++ so I can help if you can tell me what you want to do exactly. The easy interface of curl is easy to use if all you want to do is performing a request on 1 thread and its ok to call a blocking function in curl that returns only when the request is done (or a specified timeout passes). To my best knowledge in http you can pass keys in standard way by:
1. specifying key value pairs in your url as your query string
2. If the "Content-Type: application/x-www-form-urlencoded" is specified in the header of your request then the server processes the uploaded content of your request basically as a query string

What has to be used in your case? If you don't know but you have a client that already works then install a Wireshark and capture the communication. Then right-click on one of the tcp packets involved in the communication and select the "Follow tcp stream" menupoint. If you are able to capture a file upload/delete I can tell you immediately what to do.
liaoyuandeyehuo 28-Aug-13 21:33pm    
Thanks for you answer,I don't know key value pairs at first.I get it by capture packets.
pasztorpisti 29-Aug-13 5:24am    
Try to capture a communication session by uploading a small file. Then you can copy paste the contents of the "follow tcp stream" window here, of course censor out any confidental/secret info.
liaoyuandeyehuo 29-Aug-13 5:46am    
It's OK now,thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900