HTTP POST Request with Interface implementation of ApiParams and ApiFileParams
@param data
@param fileParams
@throws IOException
348502
public JsonResponse apiPost(ApiParams data, ApiFileParams fileParams) throws IOException {
        return httpRequestJson(HttpRequestMethod.POST, data, fileParams);
    }
792338
@RequestMapping(value = "/v1/upload",
            method = RequestMethod.POST,
            consumes = "multipart/form-data")
    @ResponseBody
    public final ApiHead upload(
            @RequestParam("file") final MultipartFile file) {
        if (file == null) {
            logger.info("in file upload: file is null");
            return null;
        }
        logger.info("in file upload: " + file.getOriginalFilename());
        storageService.store(file);
        final String name =
                file.getOriginalFilename().replaceAll("\\.ged", "");
        return crud().readOne(name, "");
    }
867024
public static String post(String url, Map<String, String> queryParas, byte[] data, Map<String, String> headers) {
		return HttpKit.post(url, queryParas, (new String(data)), headers);
	}
506011
public void upload(final String uri, final File sourceFile, final String contentType)
            throws IOException, AppPlatformException {
        final String path = getPath(uri);
        final HttpPut request = (HttpPut) setupRequest(path, HttpPut.METHOD_NAME, null);
        request.setEntity(contentType == null ? new FileEntity(sourceFile) : new FileEntity(sourceFile, ContentType.parse(contentType)));
        performRequest(request);
    }
158893
public static void uploadAsync(String url, String key, File file, HttpCallback callback) {
        uploadAsync(url, null, callback, new IOParam(key, file));
    }
80338
public static String post(String url,
                              Map<String, String> header,
                              Map<String, String> params) throws IOException {

        HttpURLConnection httpUrlConn = httpUrlConn(url);
        httpUrlConn.setDoOutput(true);
        httpUrlConn.setRequestMethod(Constant.RequestMethodPost);
        // header
        if (header != null) {
            header(header, httpUrlConn);
        }

        httpUrlConn.connect();

        // out
        if (params != null) {
            PrintWriter pw = new PrintWriter(httpUrlConn.getOutputStream());
            String param = Utils.getUrlParamsByMap(params);
            pw.print(param);
            pw.flush();
            pw.close();
        }

        return readIO(httpUrlConn);
    }
408980
def _post(self, url, data={}, **kwargs):
        """"""
        if 'files' in kwargs:
            req = self._session.post(self._api_prefix + url, auth=self._session.auth, data=data, **kwargs)
            return self._action(req)

        req = self._session.post(self._api_prefix + url, data=data, **kwargs)
        return self._action(req)
1094428
public void setBodyHttpDatas(List<InterfaceHttpData> datas) throws ErrorDataEncoderException {
        if (datas == null) {
            throw new NullPointerException("datas");
        }
        globalBodySize = 0;
        bodyListDatas.clear();
        currentFileUpload = null;
        duringMixedMode = false;
        multipartHttpDatas.clear();
        for (InterfaceHttpData data : datas) {
            addBodyHttpData(data);
        }
    }
788462
@Override
    protected FileInfo getFileInfoFromInputDataImpl(HTTPRequest inputData)
    {
        //get content
        Map<String,ContentPart<?>> contentPartsMap=this.getContentPartsAsMap(inputData);

        //get file info
        FileInfo fileInfo=null;
        ContentPart<?> contentPart=contentPartsMap.get(this.fileContentParameter);
        if(contentPart==null)
        {
            throw new FaxException("File info not provided.");
        }
        ContentPartType contentPartType=contentPart.getType();
        switch(contentPartType)
        {
            case FILE:
                File file=(File)contentPart.getContent();
                fileInfo=new FileInfo(file);
                break;
            case BINARY:
                byte[] data=(byte[])contentPart.getContent();

                //get file name
                String fileName=this.getContentPartAsString(contentPartsMap,this.fileNameParameter);

                fileInfo=new FileInfo(fileName,data);
                break;
            default:
                throw new FaxException("Unsupported content part type: "+contentPartType);
        }

        return fileInfo;
    }
540459
def _http_post(self, url, data, **kwargs):
        

        if not kwargs.get('file_upload', False):
            data = json.dumps(data)

        kwargs.update({'data': data})

        return self._http_request('post', url, kwargs)
665600
public RestResponse post(final String uri, final Map<String, Object> params)
            throws IOException, AppPlatformException {
        return request(getPath(uri), HttpPost.METHOD_NAME, params);
    }
668896
public void sendData() throws IOException {
        if (_writer != null) {
            _writer.write(_buffer.toString());
            _writer.flush();
            _buffer = new StringBuffer();
        }
    }
23984
def api_post_multipart(self, action, data, binary_data_param):
        
        binary_data = {}
        data = data.copy()

        try:
            file_handles = []
            for param in binary_data_param:
                if param in data:
                    binary_data[param] = file_handle = open(data[param], 'r')
                    file_handles.append(file_handle)
                    del data[param]
            json_payload = self._prepare_json_payload(data)

            return self._http_request(action, json_payload, "POST", binary_data)
        finally:
            for file_handle in file_handles:
                file_handle.close()
198868
public function post($url, array $query = [], array $data = [], array $files = [])
    {
        $url = $this->buildUrl($url, $query);

        if ($files) {
            foreach ($files as $key => $file) {
                $data[$key] = new CURLFile($file['tmp_name']);
            }
        } else {
            $data = http_build_query($data);
        }

        $handle = $this->getHandler();

        curl_setopt_array($handle, [
            CURLOPT_CUSTOMREQUEST => 'POST',
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => $data,
        ]);

        return $this->run($handle, $url);
    }
567535
public void writeData(String data) {
        _buffer.append("<![CDATA[");
        _buffer.append( data);
        _buffer.append( "]]>");
    }
471358
public String post(String url, String data, Map<String, String> headers) throws IOException {
    return doHttpTransfer(url, data, headers);
  }
696610
public static File writeDataToFile(final byte[] data, final File file, final boolean append) {
		try (FileOutputStream out = new FileOutputStream(file, append)) {
			out.write(data);
			out.flush();
			out.close();
			return file;
		} catch (Exception e) {
			JKExceptionUtil.handle(e);
			return null;
		}
	}