Skip to content

Instantly share code, notes, and snippets.

View musa-pro's full-sized avatar

Mohammad Musa musa-pro

View GitHub Profile
@musa-pro
musa-pro / RestClient.java
Created January 17, 2021 21:59
Java REST Client to consume any REST API
// File: RestClient.java
package com.example;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.*;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
@musa-pro
musa-pro / FormDataParser.java
Last active March 7, 2022 16:42
Java Parser class to use with java azure function
package com.example.util;
import org.apache.tomcat.util.http.fileupload.MultipartStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;