Giter VIP home page Giter VIP logo

Comments (9)

manucorporat avatar manucorporat commented on March 28, 2024 9

Hi guys! I just merged the Redirect pull request from @alexandernyquist in develop ceec1b6

The API is:

c.Redirect(301, "http://example.com")

from gin.

0x5487 avatar 0x5487 commented on March 28, 2024 3

Agree. c.Redirect("http://example.com") is better.

from gin.

Jackneill avatar Jackneill commented on March 28, 2024
ctx.Writer.Header().Set("Location", "/location")
ctx.Abort(302)

Does just that.

from gin.

dfilipovic39 avatar dfilipovic39 commented on March 28, 2024

ok, agree, but why would one have to know the headers and status that have to be set for redirect. it should be plain and simple one-liner call like this
c.Redirect("www.somelocation.com")
or optionally with argument to set proper 3xx status (301,302...)

from gin.

johndeng avatar johndeng commented on March 28, 2024

@tarqe39 Agree, c.Redirect("http://example.com") is easy to know about the code mean.

from gin.

johndeng avatar johndeng commented on March 28, 2024

@manucorporat Great jobs and thanks for your work. Has been long time not hear about Gin updated.

from gin.

manucorporat avatar manucorporat commented on March 28, 2024

@johndeng I am back to work, 355 days left until next stop ;)

from gin.

johndeng avatar johndeng commented on March 28, 2024

@manucorporat wow. work so hard. hope to see the Gin move to v1.0, so i can using in production. :P

from gin.

dfilipovic39 avatar dfilipovic39 commented on March 28, 2024

Thx everyone :)

from gin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.