original_docstring:  POST Method for capturing RAW FOI requests before processing
docstring: POST Method for capturing RAW FOI requests before processing
docstring_tokens: POST Method for capturing RAW FOI requests before processing
code: def post():
          """ POST Method for capturing RAW FOI requests before processing"""
          try:
              request_json = request.get_json()
              requestdatajson = request_json['requestData']  
              #get attachments
              attachments = requestdatajson['Attachments'] if 'Attachments' in requestdatajson else None
              notes = 'Request submission from FOI WebForm'
              #save request
              if attachments is not None:
                  requestdatajson.pop('Attachments')
              result = rawrequestservice().saverawrequest(requestdatajson=requestdatajson,sourceofsubmission="onlineform",userid=None,notes=notes)
              if result.success:
                  documentservice().uploadpersonaldocuments(result.identifier, attachments)                   
              return {'status': result.success, 'message':result.message,'id':result.identifier} , 200
          except TypeError:
              return {'status': "TypeError", 'message':"Error while parsing JSON in request"}, 500   
          except BusinessException as exception:            
              return {'status': exception.status_code, 'message':exception.message}, 500
code_tokens: def post ( ) : try : request_json = request . get_json ( ) requestdatajson = request_json [ 'requestData' ] attachments = requestdatajson [ 'Attachments' ] if 'Attachments' in requestdatajson else None notes = 'Request submission from FOI WebForm' if attachments is not None : requestdatajson . pop ( 'Attachments' ) result = rawrequestservice ( ) . saverawrequest ( requestdatajson = requestdatajson , sourceofsubmission = "onlineform" , userid = None , notes = notes ) if result . success : documentservice ( ) . uploadpersonaldocuments ( result . identifier , attachments ) return { 'status' : result . success , 'message' : result . message , 'id' : result . identifier } , 200 except TypeError : return { 'status' : "TypeError" , 'message' : "Error while parsing JSON in request" } , 500 except BusinessException as exception : return { 'status' : exception . status_code , 'message' : exception . message } , 500
short_docstring: POST Method for capturing RAW FOI requests before processing
short_docstring_tokens: POST Method for capturing RAW FOI requests before processing
comment: """ POST Method for capturing RAW FOI requests before processing"""$SEP$#get attachments$SEP$#save request