Questions tagged [http]

28482 questions
1

votes
1

answer
943

Views

How to use $_GET or $_POST variable to distinguish each type of request? [duplicate]

Possible Duplicate: PHP detecting request type (GET, POST, PUT or DELETE) I want to display a warning when people submit a form more than one time, and when he use GET to request a page the count variable reset to 0; I'm using this technique:
mko
0

votes
0

answer
18

Views

How to correctly fetch XML in Javascript using fetch

I have a problem when making a request using 'fetch' in a reactive native application, when reading the response I get rare characters as they are observed in the image. These correspond to 'á é í ó ú ñ' here is code: fetch('my.xml', { 'Content-Type': 'text/plain' } ) .then(response => { let x...
1

votes
2

answer
1.3k

Views

Netty - access content of chunked HTTP request (LittleProxy)

I'm intercepting an HTTP request with LittleProxy which uses Netty. However, now I want to intercept a webservice request that apparently uses chunked transfer encoding. The HTTP header looks like this Content-Type -> text/xml; charset=UTF-8 Host -> 192.168.56.1:7897 SOAPAction -> 'getSymbols' Trans...
Thomas
0

votes
0

answer
3

Views

301 Redirect in .htaccess is appending old file path/name to new url

I have two URLs: old-site.com and new-site.com. My root folder on the old-site.com has NO FILES in it but only the .htaccess file. I don’t want to use the old domain anymore. However, I do want to pass the link juice to the new domain. Therefore, I created 301 Redirects in the .htaccess file and...
Free Stylah
1

votes
3

answer
561

Views

What's the difference between a “Socks Proxy” and a “HTTP Proxy which supports CONNECT request”

I know a socks proxy is a proxy which just relays the traffic to the dst ip:port And a HTTP Proxy which support CONNECT request, it also just relays the traffic to the dest host in the http request header Is there any difference in their functions(efficiency eg)?
Alexis
1

votes
1

answer
1.7k

Views

Enable browser caching for static resources

To improve the site performance, I'm adding following http headers in IIS 7.5. Expires: Sun, 29 Mar 2020 00:00:00 GMT and Cache-Control:Public I'm adding these headers for images folder in site's virtual directory. When I access the site, I see that for each image present in this folder; those resp...
benjamin54
0

votes
0

answer
7

Views

Angular single page app works fine, but returns 404 when hitting any page except the main one

I have a single page web application written in Angular. When I run it on the local machine with ng serve, it works fine. When it is deployed to AWS, all pages except the main page return a 404 error. In other words, the 404 error occurs when trying to load any route directly. For example, / return...
K48
1

votes
1

answer
47

Views

How can I generate a Set-Cookie integration response header in AWS API Gateway?

I'm currently using Amazon's API Gateway to create a REST API that interacts directly with DynamoDB (using the 'AWS Service' integration type - there is NO lambda in-between). Everything works, except that I'd like to return a Set-Cookie header on the first response, for use with subsequent calls to...
Ryan Hilbert
-1

votes
0

answer
22

Views

Java JoptionPane: Loop or Load More

I am trying to fetch data from an ERP system using the method getFullData, which I am saving as List(list). I use this list to get detailed data from method getSingleData. The issue is that since this data is of size more than 500, I get error HTTP bad request. I can get around 40-50 data at a time,...
Tppi
0

votes
0

answer
13

Views

Is it possible to get Location header property for 302 status code without using AJAX in jquery/javascript?

When I click on a button, it posts to an action (FileDownload) in ASP.NET MVC and this action subsequently calls the RedirectToAction method in MVC to redirect to DownloadUrl. The first request return 302 status code and the second request gives me 200 status code. I am interested to read the QueryS...
Simant
1

votes
2

answer
2.1k

Views

Customizing System.Web.Http.AuthorizeAttribute within asp.net web api application

I'd like to customize System.Web.Http.AuthorizeAttribute class like this : public class MyAuthorizeAttribute : System.Web.Http.AuthorizeAttribute { public PermissionsEnum IsPermitted { get; set; } protected override bool IsAuthorized(HttpActionContext actionContext) { if (System.Web.HttpContext.Curr...
Lamloumi Afif
1

votes
3

answer
6.8k

Views

uninitialized constant Net::HTTPS (NameError)

I am trying to pull campaign stats from Clickbank API in ruby. When I run the sample code Clickbank provided. I get the following error: uninitialized constant Net::HTTPS (NameError). What am I missing? Example Code. require 'net/http' require 'net/https' http = Net::HTTPS.new('api.clickbank.com'...
0

votes
0

answer
8

Views

RestTemplate.postForObject Returns Null When ResponseEntity and Http Error Are Returned

I call a backend service to get back a PersonResponse object: PersonResponse response = restTemplate.postForObject(url, request, PersonResponse.class); The PersonResponse class contains a 'status' field to indicate if a person's info is successfully retrieved from the backend : public class PersonRe...
jlp
0

votes
0

answer
3

Views

ErrorDocument 404 parent directory

I am trying to set a custom error page in htaccess (locally on EasyPHP DevServer). I found that code but it only works if I define the project's directory (e.g. /myproject/index.php). # Does not work ErrorDocument 404 /index.php # This works ErrorDocument 404 /project/index.php I tried to search for...
CrazY D
0

votes
0

answer
3

Views

I am using jersey and i deploying my api through Tomcat 8.5.35 , but a Http 500 error always arise

this is my code. I am using IntelliJ and I am using tomcat 8.5.35 to deploy my api, and I am using Jersey to get this error 'HTTP Status 500 - Servlet.init () for servlet jersey-servlet threw exception' I could not resolve the error. Do you have an idea? this is the Pom.xml file of my project 4.0.0...
tiefu cai
0

votes
0

answer
3

Views

HTTP calls fail only on internal corp network using rest-client

HTTP calls fail on internal corp network using rest-client. I tried using other Ruby library like Net::HTTP etc but it fails too. This issue started happening a week back. It was working fine for a year. I tried using python libraries(requests, urllib2). It didn't work on requests but strangely work...
Ram
1

votes
2

answer
1.1k

Views

$http in loop, wait the results

I have this : var j = 0; // myList.length = 3 while(j < self.myList.length - 1){ $http.post('myURL', self.myList[j].code).then( function(response){ self.myList[j].plop = response.data; }, function(){ // error } ).then( function(){ // with this j++, my web page is freezing // j++; } ); // with this j...
Paladice
0

votes
0

answer
4

Views

mechanize._mechanize.FormNotFoundError: no form matching id = 'polls_form_25' while filling out form with mechanize

Basically what the title says. I'm trying to automatically fill out a form containing radio buttons, but I keep getting this error from line 7. mechanize._mechanize.FormNotFoundError: no form matching id = 'polls_form_25' Here's the raw code. import mechanize br = mechanize.Browser() br.set_handle_r...
Benjamin Fasick
1

votes
3

answer
2.4k

Views

Why is HTTP Options request insecure

I recently heard from a security audit that HTTP Options is insecure in general and the web-server should not allow it. Can someone explain the reasons why is it so ?
dogfish
1

votes
1

answer
910

Views

Setting the If-Match in the Headers C#

I have the Odata service, in order to perform a PUT we need to set the Header with If-Match: * In Post man I giving like below and it works How do I set this If-Match in the Odata Service call to perform a PUT operation.I tried the below private async Task PutJsonAsync(string messageBody,string B_C...
xyz
1

votes
1

answer
449

Views

When to initially load state from database with Vuex

I have a pretty basic vue/vuex project, and I load a list of categories from my database via a Http get request. Before incorporating Vuex into my project, I was just making the HTTP get right when I create my main component that uses the data. Now, in Vuex I have my getters and mutations and action...
Beatscribe
1

votes
1

answer
19

Views

Error while using interface and Observable with the http parsing

File Structure in VS with error app(folder) -->employee-list(folder) -->employee-list.component.html -->employee-list.component.ts -->app.component.html -->app.component.ts -->app.module.ts -->employee.json -->employee.service.ts -->employee.ts Here, all the files are on the same level and I am pass...
Shiva Chandel
0

votes
0

answer
10

Views

why Java HTTP request with the token always unauthorised

I tried the following code. Basically, this code is taken from here. There he claims it works for him. But it didn't work for me. private void doHttp() { try { String url = 'http://myurl.com/cc/companies/3.88'; String token = 'eyJ6aXAiOiJERUYiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0.....'; URL obje...
masiboo
1

votes
3

answer
457

Views

Angular 7 HTTP GET send JSON object as a parameter

Im trying to send a json structure to a rest service from angular doing something like this let test5var = { 'test5var1': { 'test5var2': '0317', 'test5var3': '9556' }, 'test5var4': '123', 'test5var': '0000046' } let dataPrincipalBlnc = {'test': {'test1': {'test2': '0317','test3': {'IDIOMA_ISO': ' e...
Endika
1

votes
2

answer
39

Views

how to hit http service deployed in cloud from postman?

I deployed my Http service in cloudhub. I'm trying to hit the service as below http://applicationName.cloudhub.io/api/emp?parm1=a&parm2=123 But i'm getting below error Do i need to change anything in my uri or in cloud hub ?
Thiru
1

votes
1

answer
37

Views

HTTP status code for upsert (insert/update) endpoint

I have a single PUT endpoint which creates/replace an entity and don't need to return a Location header or any entity body. Does it makes sense to always return 204 (No Content) or should it be 201 if it's a new entity and 204 if it replaces the entity?
Ahmed Alaa El-Din
0

votes
0

answer
15

Views

Angular/NodeJS/Express App not working on mobile

I have an application that I created that runs Angular 6, NodeJS, Express and Mongo. Currently the app is deployed to a DigitalOcean droplet and works without error on desktop/laptop browsers. Whenever I try to login over a mobile device (smartphone, tablet etc.) the connection times out. I have use...
1523carver
0

votes
1

answer
10

Views

How to make an authenticated PUT request to an App Engine service from an other origin

I have an App Engine service with a few methods implemented, where I restrict all routes with the login: admin option in the app.yaml. Making a POST request to my service works: fetch('http://localhost:8081/api/foo', { credentials: 'include'}); But making a PUT request fails await fetch('http://loca...
bastien girschig
0

votes
1

answer
28

Views

Data sent via URL (HTTP GET) vulnerable to SQL injections

I have a database where I store data of users and devices. Every user has a list of devices. When the user logs into his account the php code below generates a list of the users devices: $query_user='SELECT * FROM devices WHERE users_id = ''.$user_id.'''; $result = mysqli_query($db, $query_user); //...
Slaven Tojic
0

votes
0

answer
18

Views

fetch json data using angular.js

Simple node HTTP server is hosting JSON data on localhost/6666. Another HTTP server is setup to serve very basic angular.js application made of single index.html file and module which purpose is to fetch data: app.controller('ctrl', function ($scope, $http) { $http({ method: 'GET', url: 'localhost:6...
adict
2

votes
0

answer
8

Views

Event Stream data not showing in Chrome console

I have an EventSource listener on my frontend calling a complicated backend scheme. This code block is Typescript. import * as EventSource from 'eventsource'; private streamData() { let source = new EventSource('http://localhost:3000/websocket/server/stream'); source.onopen = (e) => { }; sourc...
plavz
1

votes
2

answer
8.3k

Views

SIM900 error 601 when sending a second POST

Using SIM 900 : AT+HTTPINIT AT+HTTPPARA='CID',1 AT+HTTPPARA='URL','www.onewebsite.fr' AT+HTTPDATA=lengthofpostdata, 10000 sending data AT+HTTPACTION=1 AT_HTTPREAD=0, lengthofreceiveddata Up to that point everything works OK Then i send a new request : AT+HTTPPARA='CID',1 AT+HTTPPARA='URL','www.onewe...
rene
0

votes
2

answer
17

Views

Laravel form submission with url parameters

When the user accesses a certain brand page, I pull the information associated with that brand. Then the user has the chance to submit an application for this brand. When the user submits the form, I want the form to post to /apply/brand/{brand_id} because I want to store this application in my appl...
Jennifer Zhou
1

votes
1

answer
1k

Views

Azure functions: Cannot bind parameter '_return' to type HttpResponseMessage

I created basic Azure function from the quickstart guide. In accordance with tutorial, this default function should work instantly, but I get an error. Function body: using System.Net; public static async Task Run(HttpRequestMessage req, TraceWriter log) { log.Info('C# HTTP trigger function processe...
Pawel Maga
0

votes
0

answer
5

Views

C# - How to make FormUrlEncodedContent from more level JSON?

I neet to make FormUrlEncodedContent from this http request body json: { 'number': 123456, 'names': { 'firstName': 'a', 'secondName': 'b', 'age': 10 } } I can make it just from 'one level' json like this: FormUrlEncodedContent content = new FormUrlEncodedContent( new List { new KeyValuePair('number'...
Banana Cake
1

votes
0

answer
6

Views

OKHttp3 how disable request redirection

I send request with wrong credentials using CloseableHttpClient from Apache and I get 401 what is expected, but in case of OKHttp3 I have response with code 400 and two prior requests with 401. My client: return new OkHttpClient.Builder() .followRedirects(false) .followSslRedirects(false) .retryOnC...
user11196410
1

votes
1

answer
89

Views

Change some Path Parameters of an Akka Http service to Query Params

I have the following code that takes path parameters; def candlesRange: Route = (path('candles' / Segment / Segment / IntNumber / LongNumber / LongNumber) & get) { (a1, a2, tf, t1, t2) => complete(apiController.apiGetCandlesRange(a1, a2, tf, t1, t2)) } But I want to change some of the parameters to...
The Applicationist
1

votes
1

answer
342

Views

How to declare an optional get parameter in Serverless Lambda?

I'd like to understand if there's a quick syntax for defining a optional pathParameter in serverless (to deploy on AWS lambda). here's what I have in my functions functions: MyFunc: handler: handler.myFunc events: - http: path: /getdata/{my_id} method: get request: parameters: paths: my_id: true I'...
koalaok
-1

votes
0

answer
41

Views

HTTP Requests in Python [on hold]

I'm trying to make an HTTP POST request in Python. I'm stuck in an error 400, the HTTP requests seems to be more difficult than I thought. I've already made it with VS Code plugin, so I think it's possible. The mainly issue is the API of Leboncoin is not documented at all and it's secure by Datadome...
Neeko
0

votes
2

answer
16

Views

Show HTML content wit PHP (and load style)

I have some HTML pages (in 'web' folder) that use some styles and scripts, and i need to show these HTML pages using a PHP script. Here is a simplified version of the code i'm using:
Badr

View additional questions