Closed rajuaryan21 closed 1 year ago
I wrote a simple program to reproduce your issue but failed. The results returned by fb.Batch
was correct as expected. Have you checked the err
? Maybe the err
is not nil.
package main
import (
"fmt"
fb "github.com/huandu/facebook"
)
func main() {
accessToken := "A VALID ACCESS TOKEN"
batchParams := fb.Params{
"access_token": accessToken,
"include_headers": false,
}
params1 := fb.Params{
"method": fb.GET,
"relative_url": "/me?fields=id,name,email",
}
params2 := fb.Params{
"method": fb.GET,
"relative_url": "/me/adaccounts?summary=total_count",
}
params3 := fb.Params{
"method": fb.GET,
"relative_url": "/6919502474734769",
}
results, err := fb.Batch(batchParams, params1, params2, params3)
fmt.Println(results)
fmt.Println(err)
}
Feel free to reopen this issue if you still have any question.
Hi,
I came across this error while trying to exclude headers from fb response as suggested by facebook here: https://developers.facebook.com/docs/graph-api/batch-requests
See under the sample batch request section. It says "&include_headers=false // Included to remove header information". I tried to add that on fb.Batch call and the result was null.
Could you please check this?
My code:
Thanks. You have created a wonderful library.