Quarantine an Infected File in Go

package mainimport (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {url := "https://api.cloudmersive.com/convert/archive/zip/create/quarantine"
method := "POST"
payload := strings.NewReader("inputFile1=%3Cbinary%3E")client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("password", "<string>")
req.Header.Add("encryptionAlgorithm", "<string>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("Apikey", "YOUR-API-KEY-HERE")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}

--

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Serverless application development with Node.js on AWS platform using Serverless framework

Great start to 2017 for JamesEmslie! https://t.co/rlGHEawOud https://t.co/x9SugwPs2g

Experience during the group project — (Research Project Management Tool)

Big O notation basics for web developers

Independent Software Testing

Pokémon and Kubernetes: How are they connected?

How to keep pair programming digestible

How to Create and Display Custom Content in WordPress?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

Setting up Vault inside Docker

Enhance the Security of .xlsx on Mac

How to debug a docker image.

How to run PostgreSQL in Docker on Mac (for local development)