Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.devbliss.doctest.httpfactory;
 
 import java.net.URI;
 
Implements a POST HTTP request which does not handle any redirect.

Author(s):
bmary
public class PostUploadWithoutRedirectImpl implements PostFactory {
    private final String paramName;
    private final FileBody fileBodyToUpload;
    public PostUploadWithoutRedirectImpl(String paramNameFileBody fileToUpload) {
        this. = paramName;
        this. = fileToUpload;
    }
    public HttpPost createPostRequest(URI uriObject payloadthrows IOException {
        HttpPost httpPost = new HttpPost(uri);
        HttpParams params = new BasicHttpParams();
        params.setParameter(.false);
        httpPost.setParams(params);
        entity.addPart();
        httpPost.setEntity(entity);
        return httpPost;
    }
New to GrepCode? Check out our FAQ X