<commit_before>import './FriendListApp.scss';

import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';

import * as FriendsActions from '../../actions/FriendsActions';
import { AddFriendInput, FriendList } from '../../components';

var Dropzone = require('react-dropzone');

class FriendListApp extends Component {

  static propTypes = {
    friendList: PropTypes.object.isRequired,
    actions: PropTypes.object.isRequired
  };


  onDrop (files) {
  console.log('Received files: ', files);
  this.callAPI(files)

  }

  callAPI(file){
    var form = new FormData();
    form.append('apikey', '4449e888-6974-45a0-8d75-a93f09a76bf0');
    form.append('file', file);

    var url="http://api.havenondemand.com/1/api/sync/ocrdocument/v1";
    fetch(url, {
        method: 'POST',
        body: form })<commit_msg>fixed file upload in POST request<commit_after>import './FriendListApp.scss';

import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';

import * as FriendsActions from '../../actions/FriendsActions';
import { AddFriendInput, FriendList } from '../../components';

var Dropzone = require('react-dropzone');

class FriendListApp extends Component {

  static propTypes = {
    friendList: PropTypes.object.isRequired,
    actions: PropTypes.object.isRequired
  };


  onDrop (files) {
  console.log('Received files: ', files);
  this.callAPI(files)

  }

  callAPI(file){
      
    var form = new FormData();
    form.append('apikey', '4449e888-6974-45a0-8d75-a93f09a76bf0');
    form.append('file', file[0]);

    var url="http://api.havenondemand.com/1/api/sync/ocrdocument/v1";
    fetch(url, {
        method: 'POST',
        body: form })
{'fraction_non_alphanumeric': 0.14994487320837926, 'fraction_numerical': 0.029217199558985666, 'mean_word_length': 3.689922480620155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6432559', 'n_tokens_mistral': 607, 'n_tokens_neox': 579, 'n_words': 127}