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

how can i set cookie on rpc server? #31

Closed
btfak opened this issue Mar 31, 2016 · 2 comments
Closed

how can i set cookie on rpc server? #31

btfak opened this issue Mar 31, 2016 · 2 comments

Comments

@btfak
Copy link

btfak commented Mar 31, 2016

func (s *Say) Hello(ctx context.Context, req *hello.Request, rsp *hello.Response) error {
    //set cookie here
    return nil
}
@btfak btfak changed the title how can i add cookie on rpc server? how can i set cookie on rpc server? Mar 31, 2016
@asim
Copy link
Member

asim commented Mar 31, 2016

Hey. There's no way to set http response headers with RPC services. If you would like to write services that serve directly back to the user with that sort of flexibility, it's best to either write API services or Web services. The default API services will allow you to set response Headers while the proxy method will allow you to basically write http handlers.

Learn more about that below:
https://github.com/micro/micro/tree/master/api
https://github.com/micro/micro/tree/master/web

@btfak
Copy link
Author

btfak commented Apr 1, 2016

get it ,thanks

@btfak btfak closed this as completed Apr 1, 2016
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