Last active
August 29, 2015 14:05
-
-
Save devtdeng/eccbe119fb0652ff111b to your computer and use it in GitHub Desktop.
test code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.io.IOException; | |
import java.util.concurrent.atomic.AtomicLong; | |
import java.util.zip.GZIPOutputStream; | |
import javax.servlet.http.HttpServletResponse; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestParam; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
public class GreetingController { | |
@RequestMapping("/zipContentNoType") | |
public void zipContentNoType(HttpServletResponse response) throws IOException { | |
response.setHeader("Content-Encoding", "gzip"); | |
GZIPOutputStream zipOutputStream = new GZIPOutputStream(response.getOutputStream()); | |
zipOutputStream.write("zipContentNoType".getBytes("UTF-8")); | |
zipOutputStream.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment