get

RestTemplate - RestClientException - Could Not Extract Response

[亡魂溺海] 提交于 2019-12-12 02:57:29
问题 I am using RestTemplate in my Spring application to interact with an API. I am doing a GET request and expecting some JSON in response. The code to do this is as follows: HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<MultiValueMap<String, String>>(null, requestHeaders); ResponseEntity responseLogin = restTemplate.exchange(url, HttpMethod.GET, requestEntity, MyResponse.class); When I run this its breaks on the following line: ResponseEntity responseLogin =

$_GET not working on my php

拥有回忆 提交于 2019-12-12 02:46:38
问题 I Call my PHP into my javascript code, may I know why $_GET not working in my PHP file? My URL is : localhost/img/index.php?fname=johndoe Javascript inside my index.php is : <script src="uploadname.js"></script> <script type="text/javascript"> $(document).ready( function() { $(\'#redactor_content\').redactor({ imageUpload: \'uploadimage.php\', minHeight: 200 // pixels }); } ); </script> php file uploadimage.php <?php $fname=$_GET['fname']; $dir = '../assets/uploads/r/'; $sysUrl = lc('sysUrl')

PHP get select option value

橙三吉。 提交于 2019-12-12 02:44:17
问题 I have a javascript function that I have to switch it into php. But in php I don't know how to make it work. The function is getting value in a select box in the page and convert it into a url link when submit is pressed. In javascript it's easy you can get the value of a select box without submitting or refreshing the page and put the value directly into the function. But in PHP I can't get the select value without refreshing the page. Example: <form name="form" method="post" action="<?php

Sessions with cURL

耗尽温柔 提交于 2019-12-12 02:37:47
问题 I think I have a very simple problem. I'm currently working on an API and before you can use it, you have to login. Logging in goes via a http request, so to login you would access http://myapi.com/login.php?email=mail@mail.com&password for example. When the email and the password are correct, I set some session variables and I start a session: session_start(); $_SESSION['idUser'] = $row['id']; $_SESSION['email'] = $row['email']; print(json_encode(array("authenticated" => true))); However,

Javascript/AJAX to PHP Page with either POST or GET

坚强是说给别人听的谎言 提交于 2019-12-12 02:33:43
问题 I have a javascript function with 2 values. I want to post those values to a PHP page where I can update a mySQL database with it. Here is what I have so far, which doesn't work. function updateDB(page1,page2) { alert("TEST"); $.ajax({ type: 'POST', url: update.php, page1: page1, page2: page2 }); } Update.php code <?php include "connect.php"; $page1 = $_POST['page1']; $page2 = $_POST['page2']; mysql_query("UPDATE `pages` SET `page1` = '$page1'"); ?> When I run the function, I get a POP up but

URL Parameters to PHP Variables

自作多情 提交于 2019-12-12 02:32:15
问题 I've been doing PHP for a while now, never needed assistance, but totally confused this time. I have a single line of code with one echo statement. Problem: URL parameters are automatically assuming PHP variable values of the same name. For example, I have a URL with a parameter named 'var_name' like this: http://www.example.com?var_name=abc123 and a 1-line PHP script with a variable named 'var_name', like this: echo $var_name; then I get output on the page of: abc123 This is the only code in

Dynamic default selection for a drop down menu using url variables

大城市里の小女人 提交于 2019-12-12 02:06:40
问题 I have several links on one page which all direct to the same page, but each of them passes a different variable in the URL (http://sitename.com/thispage.php?id=3). I set new variables to true or false depending on which value is passed for "id", then put the true/false variables in to set the default option on an option tag like so: if (isset($_GET['id'])) $id = ($_GET['id']); if ($id = 4) $id4 = true; else $id4 = false; ... <option value="Value" selected="<?php echo "$id4"; ?>"> Value <

I dont get HTTP answer with sr function. Just an ACK

孤街醉人 提交于 2019-12-12 01:58:13
问题 I am trying to send an HTTP GET request to google.com, but the answer I get is an ACK and not the HTML file. Here is the code: def Make_Get(): synR = IP(dst = 'www.google.com', ttl = 64)/TCP(dport = 80,sport = randint(1024,65535), flags = 'S') synAckAN = sr1(synR) req = (IP(dst='www.google.com') / TCP(dport=80, sport=synAckAN[TCP].dport, seq=synAckAN[TCP].ack, ack=synAckAN[TCP].seq + 1, flags='A')/"GET / HTTP/1.0 \n\n") ans, a = sr(req) return ans and this are the two packets I got in return

Servlet error HTTP Status 405 - HTTP method GET is not supported by this URL

﹥>﹥吖頭↗ 提交于 2019-12-12 01:53:15
问题 I've written the following Servlet (Search1.java): package ergasia; import java.sql.*; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.ArrayList; public class Search1 extends HttpServlet { @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); Connection connection= null; String url = "jdbc:mysql://localhost:3306/"; String dbName = "ergasia";

blackberry HttpConnection.GET

亡梦爱人 提交于 2019-12-12 01:48:45
问题 URL: http://monSite/GET.asp we must authenticate before getting the result. I want to send the login and password with HttpConn.setRequestMethod (HttpConnection.POST) and retrieve the XML file with HttpConn.setRequestMethod (HttpConnection.GET) with the same HTTP Client. conn = (HttpConnection) new ConnectionFactory().getConnection(_url).getConnection(); URLEncodedPostData postData = null; postData = new URLEncodedPostData("UTF-8", false); postData.append("userName",_username); postData