http-post

Retrofit POST Request with body parameters android

佐手、 提交于 2020-07-10 07:51:35
问题 I need to execute post request with retrofit but i have a problem which i can't understand very well. Before trying with code i tested api call with Postman and request look like this: Here is my android code: public class API { private static <T> T builder(Class<T> endpoint) { return new Retrofit.Builder() .baseUrl(Utils.API_BASE_URL) .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonConverterFactory.create()) .build() .create(endpoint); } public static

VBA POST json to API

别等时光非礼了梦想. 提交于 2020-07-09 07:28:17
问题 I am trying to write VBA to post json to an api and parse the results into a worksheet. I can generate the JSON and am confident I can parse the result into what I need. I know there are online tools to convert json to vba and back and browser add ins to post requests but I am the only one in the office that can do this so if I'm sick or on leave I would like to automate it. To do that I need to send the json and maybe store the response so I can parse it. I'm new to coding so posting a

How do I upload a file using http post? Delphi 2009

人走茶凉 提交于 2020-07-05 07:26:56
问题 My goal is to upload a text file via HTTP post I am using Delphi 2009. Say for example to the following URL https://www.example.com/ex/exampleAPI.asmx/Process I understand it can be done by using the TIdHttp component. And the following call IdHttp1.Post(); But I cant figure out how to set up everything i.e. specifying the url and including the file to be posted. Thanks. 回答1: TIdHTTP has two overloaded versions of Post() that take a filename as input: var Response: String; Response := IdHTTP1

How do I upload a file using http post? Delphi 2009

偶尔善良 提交于 2020-07-05 07:25:10
问题 My goal is to upload a text file via HTTP post I am using Delphi 2009. Say for example to the following URL https://www.example.com/ex/exampleAPI.asmx/Process I understand it can be done by using the TIdHttp component. And the following call IdHttp1.Post(); But I cant figure out how to set up everything i.e. specifying the url and including the file to be posted. Thanks. 回答1: TIdHTTP has two overloaded versions of Post() that take a filename as input: var Response: String; Response := IdHTTP1

Using Mimes for Validating Laravel File Post - Word File

匆匆过客 提交于 2020-06-27 16:19:12
问题 I have a form that I post file. I am trying to use validation to accept only word documents. I tried using mime types however doesn't seem to work and I couldn't spot my mistake. <form action="" method="post"> <div class="form-group{{ $errors->has('myFile') ? ' has-error' : '' }}"> <div class="col-xs-12"> <div class="form-material"> <input class="form-control" type="file" id="myFile" name="myFile"> <label for="myFile">MyFile</label> @if ($errors->has('myFile')) <div {{ $errors->first('myFile'

Using Mimes for Validating Laravel File Post - Word File

孤街浪徒 提交于 2020-06-27 16:18:15
问题 I have a form that I post file. I am trying to use validation to accept only word documents. I tried using mime types however doesn't seem to work and I couldn't spot my mistake. <form action="" method="post"> <div class="form-group{{ $errors->has('myFile') ? ' has-error' : '' }}"> <div class="col-xs-12"> <div class="form-material"> <input class="form-control" type="file" id="myFile" name="myFile"> <label for="myFile">MyFile</label> @if ($errors->has('myFile')) <div {{ $errors->first('myFile'

Django/Auth: Can request.user be exploited and point to other user?

ぃ、小莉子 提交于 2020-06-25 18:09:25
问题 Let's say i have a form that does something in database and requires user authentication that has been sent by POST, is it possible inside request someone evil to change the user in order to exploit the system? The following example creates an item in database but requires a logged in user. Can someone send other user's data in request.user ? from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from items_core.models import Item from items

Django/Auth: Can request.user be exploited and point to other user?

你。 提交于 2020-06-25 18:06:13
问题 Let's say i have a form that does something in database and requires user authentication that has been sent by POST, is it possible inside request someone evil to change the user in order to exploit the system? The following example creates an item in database but requires a logged in user. Can someone send other user's data in request.user ? from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from items_core.models import Item from items

How to post traditional form into iframe within an Angular 4 app

守給你的承諾、 提交于 2020-06-11 14:30:07
问题 I'm attempting to do a traditional form post into an iframe from within an Angular 4 app and it's simply posting into a new tab. I had trouble posting the form at all until I added ngNoForm to the form element so I'm assuming that I need to do something else (maybe to the iframe element?) My form tag looks like: <form ngNoForm method="POST" action="http://some.url" target="responseFrame" > My iframe tag looks like: <iframe id="responseFrame" name="responseFrame" src=""></iframe> 回答1: Update:

Http response: Cannot convert JSON into stream

最后都变了- 提交于 2020-05-16 07:13:06
问题 I have an API in JAVA to upload a zip file to a server in Delphi, and I am doing it as follows: DSRESTConnection conn = new DSRESTConnection(); conn.setHost("example.com"); conn.setPort(8080); TServerMethods1 proxy = new TServerMethods1(conn); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); BufferedOutputStream bos = new BufferedOutputStream(baos); ZipOutputStream zos = new ZipOutputStream(bos); zos.putNextEntry(new ZipEntry("test.json")); byte[] bytes = inputJson.getBytes();