Is there a possibility to marshal array of bson.M?
I get the error:
WriteArray can only write a Array while positioned on a Element or Value
but is positioned on a TopLevel
My wish is to marshall array ob bason.M objects.
Regards
--
You received this message because you are subscribed to the Go
It means in the body of func/handler responsible for this POST Endpoint I
pack the necessary actions and each time client calls this endpoint those
actions will be also executed.
Then I do not need to check regularly when called this endpoint of server.
Sorry for my naivety
Am Di., 7. Dez. 2021
And this POST endpoint should be checked regularly to see when the changes
happened? As by each change the server does some action.
As the server immediately after each POST request from client, need to do
some action. How guarantee this in Go?
Am Di., 7. Dez. 2021 um 14:11 Uhr schrieb Brian Candl
Hi,
having a server written in Go: this server provides an endpoint.
The client(or consumer) calls this endpoint to notify server about the
changes by him.
My question is: How this server can check the notifications received from
client?
Available implementation approaches are unknown to me.
Thank
if error happens by io.Copy, can I set the status Code of w after io.Copy?
Am Do., 7. Okt. 2021 um 13:41 Uhr schrieb RiSi :
>
> *w.Header().Set("Content-Type", "application/xml")*
>
> *_, err:=io.Copy(w,src) *
>
> *if err!=nil{*
> *re := &res{ M
*w.Header().Set("Content-Type", "application/xml")*
*_, err:=io.Copy(w,src) *
*if err!=nil{*
*re := &res{ Message: "Error happened",}*
*w.Header().Set("Content-Type", "application/json")w.WriteHeader(599)
//sample status codeerr = json.NewEncoder(w).Encode(re)*
*}//if*
*the part after err!=ni