err = json.NewDecoder(res.Body).Decode(&gr)
if err != nil {
log.Println("ERROR:", err)
return
}
Using json.newdecoder to decode the coming response body from client?
Here is also the issue of " loading the entire response in memory and
parsing it" is a matter?
As I am not using a buffer to copy?
I want to unmarshal an xml data to a data structure.
Problem is the following
This xml comes from a Odata Server and has fields "edmx:Edmx".
How should the fields of struct be named?
I observe that the fields name of struct representing xml should be the
same name as xml field name.
Now how on
What is the best approach to convert xml to json?
However I need above all to parse a very complex xml to see if related
properties are existing.
I thought maybe converting it to Json maybe make it easier.
--
You received this message because you are subscribed to the Google Groups
"golang-
How can I copy resp.Body to a *bytes.Buffer?
I am new to go.
resp.Body is the response which I get from client.Do, and is of type
*http.Response
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving
Best practice in following scenario:
In my func for an endpoint (handler) with func hello(w
http.ResponseWriter, req *http.Request)
I call another server get the resp.Body (Body io.ReadCloser) and want to
write this Body in w (ResponseWriter ).
What is best practice?
I have already copied dir
m the buffer can't fail, and errors from writing to the
> ResponseWriter you can ignore. Or, if you don't want to buffer the result,
> live with the fact that the client might get a partial response.
>
>
> On Wed, Oct 6, 2021 at 3:04 PM RS wrote:
>
>> Hi All,
riting to the
> ResponseWriter you can ignore. Or, if you don't want to buffer the result,
> live with the fact that the client might get a partial response.
>
>
> On Wed, Oct 6, 2021 at 3:04 PM RS wrote:
>
>> Hi All,
>> we copy response body from a call into *
Hi All,
we copy response body from a call into *responseWriter* w.
my question is:
a) if err!=nil, it is possible that w is also not nil? Or no: if err!=nil
then w is nil.
b) the following order is correct?
I would send response body (which is in *src* (resp.Body type
io.ReadCloser)) as xml co
Hi,
via *swagger generate client -f file.json* I have created client side
golang codes. The question is how can I use those generated codes for each
REST API in my golang project as consumer.
As a golang/swagger-newbie an example would be appreciated.
Thanks
Larisa
--
You received this me