Validate a Full Name in Go

package mainimport (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {url := "https://api.cloudmersive.com/validate/name/full-name"
method := "POST"
payload := strings.NewReader(`{
"FullNameString": "<string>"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
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

Day 5 — Creating the building blocks for our player

RxSwift — Coordinator Pattern done right™

Django for Backend Web-Development — Advantages &Future

XML file configuration in TestNG framework

MongoDB GridFS vs S3 Storage

Privacera Expands Support for Databricks on Google Cloud

WooKey’s Dash Wallet (Android Version) User Guide(Part 3/3) — — How to Use Your Dash Wallets?

Industry Use-Cases solved by Ansible

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

What is Backend as a service (BaaS)? | VYou

Check if IP address is a Known Threat in Node.js

Authentication, Single Sign ON, Session & Cookies

Installing MongoDB on Mac (Catalina, Monterey) SOLUTION