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

[QUESTION] post request return 200 ok by postman, no data, but js code request is ok , has data, why ? #2447

Open
jiulu313 opened this issue Apr 20, 2024 · 1 comment
Assignees

Comments

@jiulu313
Copy link

Describe the bug
post request return 200 ok by postman, no data, but js code request is ok , has data, why ?

my version:
github.com/kataras/iris/v12 v12.2.5
github.com/iris-contrib/middleware/cors v0.0.0-20220921193907-d3e7dfb17c8f

go: 1.21

there are my some code and img
image

image
image

if I change the method post as get and use postman, it is ok , has body json data
but the method is post, it is ok, no data.

please help me , thank you!

@kataras kataras changed the title [BUG] post request return 200 ok by postman, no data, but js code request is ok , has data, why ? [QUESTION] post request return 200 ok by postman, no data, but js code request is ok , has data, why ? Apr 24, 2024
@kataras
Copy link
Owner

kataras commented Apr 24, 2024

Hello @jiulu313, so with javascript code you get body but with postman you don't. I need more information about your handler, did you try to manually add it using a simple func(ctx iris.Context) { ... } instead of the GetAllTag? What's the contents of the tiger.NewTagService(c.Ctx).GetAllTag()? I am marking this as question because the framework has nothing to do between js code or postman to retrieve data from the server.

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

No branches or pull requests

2 participants