DEV Community

Ega Prasetya
Ega Prasetya

Posted on

Echo Go - Parsing HTTP Request Payload

So in this chapter we will to learn how to parsing variation request payload in echo go, so let`s do it.

In payload HTTP Request can to send various forms. We will to learn how to handle 3 this payload.

  • Form Data
  • JSON Payload
  • XML Payload

Parsing Request Payload

Way parsing request payload in echo is very simple, whatever the type of payload, API used for parsing is same.

So create main.go and follow this code.

Alt Text

TESTING

i use POSTMAN for the testing, u can use CURL or anything.

  • Form Data

Alt Text

  • JSON Payload

Alt Text

  • XML Payload

Alt Text

Finally! Try at home.

Top comments (2)

Collapse
 
tmack8080 profile image
tmack8080

Very cool. Thanks for posting this.

Collapse
 
egaprsty profile image
Ega Prasetya • Edited

U are welcome bro! i am so sorry for my listening, my english is bad lol