有没有一种方法可以序列化golang http请求对象并保留在数据库中

I need to make a http call in golang code. My server code will create the http request object and put it in database.

The worker code will get the data from the DB and should be able to make the http call using the persisted request object.

Can I directly persist the request object in DB by serializing the http request or do I need to add method/URL/body separately in the database?

Yes you can: https://golang.org/pkg/net/http/httputil/#DumpRequest

import "net/http/httputil"

dumped, err := httputil.DumpRequest(req, true)