Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Map;
import java.util.Map.Entry;

import org.apache.http.client.methods.HttpUriRequest;

public class Main {
    private static void setHeader(HttpUriRequest request, Map<String, String> headers) {
        if (headers == null || headers.size() == 0) {
            throw new NullPointerException("headers not be null");
        }
        for (Entry<String, String> entry : headers.entrySet()) {
            request.addHeader(entry.getKey(), entry.getValue());
        }
    }
}