Skip to content

Instantly share code, notes, and snippets.

Avatar

Mohammad Musa musa-pro

View GitHub Profile
@musa-pro
musa-pro / FormDataParser.java
Last active Mar 7, 2022
Java Parser class to use with java azure function
View FormDataParser.java
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.*;
@musa-pro
musa-pro / RestClient.java
Created Jan 17, 2021
Java REST Client to consume any REST API
View RestClient.java
// 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;