本文整理汇总了Java中org.apache.commons.httpclient.methods.FileRequestEntity类的典型用法代码示例。如果您正苦于以下问题:Java FileRequestEntity类的具体用法?Java FileRequestEntity怎么用?Java FileRequestEntity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FileRequestEntity类属于org.apache.commons.httpclient.methods包,在下文中一共展示了FileRequestEntity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAccount
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void createAccount() throws HttpException, IOException {
File input = new File(testFolder + "Account.xml");
PostMethod post =
new PostMethod(cadURL + "/object/User?_type=xml&externalServiceType=FBMC&externalUsername=8x8webservice&externalPassword=E4qtjWZLYKre");
post.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + post.getURI());
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + post.getResponseBodyAsString());
} finally {
post.releaseConnection();
}
}
示例2: updateAccount
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void updateAccount() throws HttpException, IOException {
System.out.println("Sent HTTP PUT request to update Account");
File input = new File(testFolder + "Account.xml");
PutMethod put =
new PutMethod(cadURL + "/object/User?_type=xml&externalServiceType=FBMC&externalUsername=8x8webservice&externalPassword=E4qtjWZLYKre");
put.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
put.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
int result = httpclient.executeMethod(put);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + put.getResponseBodyAsString());
} finally {
put.releaseConnection();
}
}
示例3: createCustomer
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void createCustomer() throws HttpException, IOException {
System.out.println("Sent HTTP POST request to add Customer");
File input = new File(testFolder + "Customer.xml");
PostMethod post = new PostMethod(cadURL + "/object/customer?_type=xml");
post.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + post.getURI());
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + post.getResponseBodyAsString());
} finally {
post.releaseConnection();
}
}
示例4: updateCustomer
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void updateCustomer() throws HttpException, IOException {
System.out.println("Sent HTTP PUT request to update Customer");
File input = new File(testFolder + "Customer.xml");
PutMethod put = new PutMethod(cadURL + "/object/customer?_type=xml");
put.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
put.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + put.getURI());
int result = httpclient.executeMethod(put);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + put.getResponseBodyAsString());
} finally {
put.releaseConnection();
}
}
示例5: createLead
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void createLead() throws HttpException, IOException {
System.out.println("Sent HTTP POST request to create Lead");
File input = new File(testFolder + "Lead.xml");
PostMethod post = new PostMethod(cadURL + "/object/lead?_type=xml");
post.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + post.getURI());
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + post.getResponseBodyAsString());
} finally {
post.releaseConnection();
}
}
示例6: createContact
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void createContact() throws HttpException, IOException {
System.out.println("Sent HTTP POST request to createContact");
File input = new File(testFolder + "Contact.xml");
PostMethod post = new PostMethod(cadURL + "/object/oltp?_type=xml");
post.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + post.getURI());
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + post.getResponseBodyAsString());
} finally {
post.releaseConnection();
}
}
示例7: updateContact
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void updateContact() throws HttpException, IOException {
System.out.println("Sent HTTP POST request to createContact");
File input = new File(testFolder + "Contact.xml");
PutMethod put = new PutMethod(cadURL + "/object/oltp?_type=xml");
put.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
put.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + put.getURI());
int result = httpclient.executeMethod(put);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + put.getResponseBodyAsString());
} finally {
put.releaseConnection();
}
}
示例8: createFAQCatagory
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void createFAQCatagory() throws HttpException, IOException {
System.out.println("Sent HTTP POST request to createFAQCatagory");
File input = new File(testFolder + "FAQCatagory.xml");
PostMethod post = new PostMethod(cadURL + "/object/faqcategory?_type=xml");
post.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + post.getURI());
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + post.getResponseBodyAsString());
} finally {
post.releaseConnection();
}
}
示例9: createUser
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void createUser() throws HttpException, IOException {
File input = new File(testFolder + "User.xml");
PostMethod post = new PostMethod(cadURL + "/object/user?_type=xml&batch=dummy");
post.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + post.getURI());
int result = httpclient.executeMethod(post);
System.out.println("hii");
System.out.println("Response status code: " + result);
System.out.println("Response body: " + post.getResponseBodyAsString());
} finally {
post.releaseConnection();
}
}
示例10: updateUser
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void updateUser() throws HttpException, IOException {
File input = new File(testFolder + "User.xml");
PutMethod put = new PutMethod(cadURL + "/object/user?_type=xml");
put.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
put.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + put.getURI());
int result = httpclient.executeMethod(put);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + put.getResponseBodyAsString());
} finally {
put.releaseConnection();
}
}
示例11: createTask
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void createTask() throws HttpException, IOException {
File input = new File(testFolder + "Task.xml");
PostMethod post = new PostMethod(cadURL + "/object/task?_type=xml");
post.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + post.getURI());
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + post.getResponseBodyAsString());
} finally {
post.releaseConnection();
}
}
示例12: createSupportCase
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void createSupportCase() throws HttpException, IOException {
File input = new File(testFolder + "SupportCase.xml");
PostMethod post = new PostMethod(cadURL + "/object/supportcase?_type=xml");
post.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + post.getURI());
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + post.getResponseBodyAsString());
} finally {
post.releaseConnection();
}
}
示例13: createPhoneCall
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void createPhoneCall() throws HttpException, IOException {
File input = new File(testFolder + "PhoneCall.xml");
PostMethod post = new PostMethod(cadURL + "/object/phonecall?_type=xml");
post.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + post.getURI());
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + post.getResponseBodyAsString());
} finally {
post.releaseConnection();
}
}
示例14: createOpportunity
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void createOpportunity() throws HttpException, IOException {
File input = new File(testFolder + "Opportunity.xml");
PostMethod post = new PostMethod(cadURL + "/object/opportunity?_type=xml");
post.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + post.getURI());
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + post.getResponseBodyAsString());
} finally {
post.releaseConnection();
}
}
示例15: createIncident
import org.apache.commons.httpclient.methods.FileRequestEntity; //导入依赖的package包/类
private static void createIncident() throws HttpException, IOException {
File input = new File(testFolder + "Incident.xml");
PostMethod post = new PostMethod(cadURL + "/object/incident?_type=xml");
post.addRequestHeader("Content-Type", "application/xml");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
System.out.println("URI: " + post.getURI());
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: " + post.getResponseBodyAsString());
} finally {
post.releaseConnection();
}
}