http-post

Open a new popup window and post data to it

£可爱£侵袭症+ 提交于 2019-11-30 09:41:14
I'm using jQuery to open a popup and I'd like to send it data using the post method when it opens. Can anyone help me, thanks in advance. I am currently passing the data using the get method so the data is a part in url, but I don't want the data to be visible in the url. function openWindow(){ var name = $('#name').val(); var url = 'popup_window.php?name='+name; window.open( url, 'popUpWindow', 'height=400, \ width=650, \ left=300, \ top=100, \ resizable=yes, \ scrollbars=yes, \ toolbar=yes, \ menubar=no, \ location=no, \ directories=no, \ status=yes'); } Barmar This is based on the answer in

Post and redirect to external site from Rails controller?

做~自己de王妃 提交于 2019-11-30 09:24:49
问题 After the user registration page, web clients will come to this page, which contains only a proceed button. But I want to skip this page and proceed to the payment page. Is there any way to do this action completely in the controller? <form method="post" action="https://www.ccavenue.com/shopzone/cc_details.jsp"> <input type=hidden name=Merchant_Id value="<%= @Merchant_id %>"> <input type=hidden name=Amount value="<%= @Amount %>"> <input type=hidden name=Order_Id value="<%= @user_id %>">

Why do I need FromBody Attribute when expecting data in POST body

独自空忆成欢 提交于 2019-11-30 09:02:52
I can send my data to the server but ONLY when I use the FromBody-Attribute. Why is the json data not automatically read from the Body using a Post? Backend web api [HttpPost] public async Task<IActionResult> Post([FromBody]CreateSchoolyearRequestDTO dto) { } Frontend angularjs this.createSchoolyear = function (schoolyear) { var path = "/api/schoolyears"; return $http({ url: path, method: "POST", data: schoolyear, contentType: "application/json" }).then(function (response) { return response; }); }; Just because something is a POST request, there is no clear rule how arguments are being

Host name may not be null in HttpResponse execute for android

ぃ、小莉子 提交于 2019-11-30 08:20:47
问题 I get the error "Target host must not be null, or set in parameters". I DO have Internet permission in my manifest file I have put 'http://' before my Url I DO encode the URL This is my code: String url = "http://maps.google.com/maps/api/directions/json?origin=1600 Pennsylvania Avenue NW, Washington, DC 20500&destination=1029 Vermont Ave NW, Washington, DC 20005&sensor=false"; HttpClient httpclient = new DefaultHttpClient(); String goodURL = convertURL(url);//change weird characters for %etc

Sending data from excel to Server using HTTP Post

寵の児 提交于 2019-11-30 07:45:53
How can I send data to Server from excel using HTTP Post? Lets say the URL is: http://testingHttpPost/ And I want to send data from Cells A2 and B2. How would I get this done in VBA? Thanks in advance Tim Williams Sub XMLPost() Dim xmlhttp, sData As String With ActiveSheet sData = "x=" & URLencode(.Range("A2").Value) & _ "&y=" & URLencode(.Range("B2").Value) End With Set xmlhttp = CreateObject("microsoft.xmlhttp") With xmlhttp .Open "POST", " http://testingHttpPost/", False .setrequestheader "Content-Type", "application/x-www-form-urlencoded" .send sData Debug.Print .responsetext End With End

R - posting a login form using RCurl

你离开我真会死。 提交于 2019-11-30 07:44:25
I am new to using R to post forms and then download data off the web. I have a question that is probably very easy for someone out there to spot what I am doing wrong, so I appreciate your patience. I have a Win7 PC and Firefox 23.x is my typical browser. I am trying to post the main form that shows up on http://www.aplia.com/ I have the following R script: your.username <- 'username' your.password <- 'password' setwd( "C:/Users/Desktop/Aplia/data" ) require(SAScii) require(RCurl) require(XML) agent="Firefox/23.0" options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem",

How to HTTP POST a XML File using PHP without cURL? [duplicate]

亡梦爱人 提交于 2019-11-30 07:37:26
This question already has an answer here: How to post data in PHP using file_get_contents? 3 answers I have a XML created from a Table In MySql, I need to make a HTTP Post to insert the XML into a Web Service. The Web Service just accepts SOAP, HTTP POST and HTTP GET methods. I tried to make the HTTP POST request in different ways with no luck at all. I never worked with SOAP before. How can I make the HTTP POST or SOAP Request? post_xml.xml: <?xml version="1.0" encoding="utf-8"?> <?ADF version="1.0"?> <adf> <prospect><id sequence="1" source="xxxs">37</id> <requestdate>2013-07-10 06:10:42<

Using Google Apps Script to Post JSON Data

五迷三道 提交于 2019-11-30 07:03:57
Server response : HTTP Status 415 - Unsupported Media Type I am trying to post JSON data to the URL from google script but getting the above error. Here is my code: function myFunctionpost() { var url = "http://abc.xyz.org/jira/rest/api/2/issue"; var data = {"project":{ "key": "KEY"},"summary": "create issue.", "description": "Creating of an issue from google spreadsheet using the REST API", "issuetype": {"name": "Bug"}} ; var payload = JSON.stringify(data); var headers = { "Accept":"application/json", "Content-Type":"application/json", "Authorization":"Basic _authcode_" }; var options = {

How to post a photo. iOS Facebook SDK 3.1

◇◆丶佛笑我妖孽 提交于 2019-11-30 07:02:06
I needed to publish a picture on my wall. The pic is generated in my iPad app. This is the simplest way I've found - (void) postImageToFB:(UIImage*)image { NSData* imageData = UIImageJPEGRepresentation(image, 90); NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"This is my drawing!", @"message", imageData, @"source", nil]; [FBRequestConnection startWithGraphPath:@"me/photos" parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { }]; } if you want to post on a friend's wall, change @"me/photos" by

Post data and refresh page

狂风中的少年 提交于 2019-11-30 05:30:56
I have an edit-form page to edit my website posts. It uses post method to the same page. If the form is compiled correctly shows up a congrats message. The problem: When users hit the refresh button the script tries to repost the data again to page. Is there a way to avoid this? thanks Luca The general outline of the PRG pattern is this: if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) { /// do your magic $_SESSION['error'] = "Thanks for your message!"; // this should be the full URL per spec, but "/yourscript.php" will work $myurl = ...; header("Location: $myurl"); header("HTTP/1.1 303 See Other")