Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.net.HttpURLConnection;
import java.net.ProtocolException;

public class Main {
    public static void setUpConnection(HttpURLConnection connection, String method) {
        try {
            connection.setRequestMethod(method);
            connection.setDoInput(true);
            connection.setDoOutput(true);
            connection.setRequestProperty("Content-Type", "application/json");
        } catch (ProtocolException e) {
            e.printStackTrace();
        }

    }
}