Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transfer a wireshark captured http request to a curl request

Tags:

curl

wireshark

I am trying to simulate a post request from a system I am not familiar with(http thrift).

With wire shark, I get the http request like :enter image description here.

But I am going to perform a stress test with tools like ab, so How I can transfer a Wireshark package to a ab or curl command http request ?

like image 390
FisherMartyn Avatar asked Apr 11 '16 09:04

FisherMartyn


People also ask

How do I send a HTTP request on curl?

To make a GET request using Curl, run the curl command followed by the target URL. Curl automatically selects the HTTP GET request method unless you use the -X, --request, or -d command-line option.

How do you send data with curl GET request?

When the -F option is used, curl sends the data using the multipart/form-data Content-Type. Another way to make a POST request is to use the -d option. This causes curl to send the data using the application/x-www-form-urlencoded Content-Type.

What HTTP method does curl use?

curl knows the HTTP method If you just pass in a HTTP URL like curl http://example.com , curl will use GET. If you use -d or -F curl will use POST, -I will cause a HEAD and -T will make it a PUT.

Does curl use HTTP?

cURL supports several different protocols, including HTTP and HTTPS, and runs on almost every platform.


1 Answers

Here are two tools that can help you:

  1. h2c, HTTP headers to curl, which converts a HTTP request to a suitable curl command line. (written by me)
  2. pcap2curl, which is similar in style but instead converts a saved PCAP file with a HTTP request to a curl command line.
like image 76
Daniel Stenberg Avatar answered Oct 21 '22 03:10

Daniel Stenberg