Hello,
I'm using json.Marshal to convert a struct to Json, for the purpose of posting said json to a rest end point.
The struct looks like this;
type Lead struct {
LeadNumber string `json:"Lead_Number__c"`
FirstName string
LastName string
Company string
Email string
Description string
}
After the post, I get the same resource back in the response.
I need to exclude the LeadNumber filed from the POST, as that field is read only, and assigned by the server. I want to read that same value back into my struct from the http.Response
How do I exclude a specific field from being converted when using json.Marshal? Keep in mind, I need to fill the field during json.Unmarshal.
Thanks!
-Jev