Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post body missing #11

Closed
kelvinji2009 opened this issue Mar 18, 2018 · 2 comments
Closed

Post body missing #11

kelvinji2009 opened this issue Mar 18, 2018 · 2 comments

Comments

@kelvinji2009
Copy link

Hi,

Sample code(Using default http client)

	 req := graphql.NewRequest(`
	 	query {
	 		getAccessTokenByAppSecret(
				clientId: $clientID,
				secret: $appSecret
			)
	 	}
	 `)

	req.Var("clientID", clientID)
	req.Var("appSecret", appSecret)

	ctx := context.Background()

	var responseData map[string]interface{}

	if err := c.userGraphqlClient.Run(ctx, req, &responseData); err != nil {
		log.Fatal(err)
	}

Log info

☆  examples  »go run main.go
2018/03/18 01:52:04 >> variables: {"appSecret":"5cf63e2b82f2d6b41bdcfec8b483b740","clientID":"5a48b6ae863b3b0001893bbc"}

2018/03/18 01:52:04 >> files: 0
2018/03/18 01:52:04 >> query:
		query {
			getAccessTokenByAppSecret(
				clientId: $clientID,
				secret: $appSecret
			)
		}

2018/03/18 01:52:04 >> headers: map[Content-Type:[multipart/form-data; boundary=f262269d26f9acbc6a727ad9e0becd29acbc33c1f0110691763f4cb54862] Accept:[application/json]]
2018/03/18 01:52:05 << POST body missing. Did you forget use body-parser middleware?
2018/03/18 01:52:05 decoding response: invalid character 'P' looking for beginning of value
exit status 1
@matryer
Copy link
Contributor

matryer commented May 24, 2018

Please update and try again following #15.

@kelvinji2009
Copy link
Author

@matryer Great. It works now. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants