Questions tagged [basicnamevaluepair]

A simple class encapsulating an attribute/value pair in Java. Usually used for creating HttpPost

This class comforms to the generic grammar and formatting rules outlined in the Section 2.2 and Section 3.6 of RFC 2616 2.2 Basic Rules The following rules are used throughout this specification to describe basic parsing constructs. The US-ASCII coded character set is defined by ANSI X3.4-1986.

OCTET =
CHAR =
UPALPHA =
LOALPHA =
ALPHA = UPALPHA | LOALPHA DIGIT =
CR =
LF =
SP =
HT =
<"> =

Many HTTP/1.1 header field values consist of words separated by LWS or special characters. These special characters MUST be in a quoted string to be used within a parameter value (as defined in section 3.6).

 token          = 1* 
 separators     = "(" | ")" | "<" | ">" | "@"
                | "," | ";" | ":" | "\" | <">
                | "/" | "[" | "]" | "?" | "="
                | "{" | "}" | SP | HT

A string of text is parsed as a single word if it is quoted using double-quote marks.

 quoted-string  = ( <"> *(qdtext | quoted-pair ) <"> )
 qdtext         =  ">>

The backslash character ("\") MAY be used as a single-character quoting mechanism only within quoted-string and comment constructs.

 quoted-pair    = "\" CHAR

3.6 Transfer Codings Parameters are in the form of attribute/value pairs.

 parameter               = attribute "=" value
 attribute               = token
 value                   = token | quoted-string
34 questions
276
votes
16 answers

How to add parameters to HttpURLConnection using POST using NameValuePair

I am trying to do POST with HttpURLConnection(I need to use it this way, can't use HttpPost) and I'd like to add parameters to that connection such as post.setEntity(new UrlEncodedFormEntity(nvp)); where nvp = new…
Michal
  • 15,429
  • 10
  • 73
  • 104
33
votes
7 answers

NameValuePair deprecated for openConnection

I been following online tutorials on how to insert data into a database from an android app and have everything working except this small part List params = new ArrayList<>(); params.add(new BasicNameValuePair("username",…
user1949387
  • 1,245
  • 3
  • 21
  • 38
6
votes
2 answers

NameValuePair is deprecated in API 22

Now that namevaluepair is deprecated in API 22. What can i do if i want to implement 'namevaluepair' interface. below is my code package com.example.passpass; import org.apache.http.NameValuePair; public class DoubleNameValuePair implements…
Apsaliya
  • 136
  • 3
  • 10
5
votes
1 answer

Passing Parameters with HttpURLConnection

With the old Apache stuff deprecated in API 22, I am finally getting around to updating my network stuff. Using openConnection() seems pretty straight forward. However, I have not seen any good example to send parameters with it. How would I update…
TheLettuceMaster
  • 15,594
  • 48
  • 153
  • 259
4
votes
1 answer

Android volley post request using name value pairs

I am using the volley library for making a post request to the server. This library uses Map for the post parameters. My problem is want to have multiple values for the same key, which can be using NameValuePairs but it cannot be…
4
votes
2 answers

Http post in android with nested associative array

I am trying to send an http post request to a PHP service. Here is an example of how the input may look with some test data I know that the Java alternative to the PHP associative arrays are HashMaps, but I wonder can this be done with…
2
votes
6 answers

Is it possible to send Arraylist as value to a single key in BasicValuePair in android

Hi i have multi dimensional array format data.I need to pass these datas with basicnamevaluepair to POST method.Is there any possible to pass the entire arraylist as value to single key in android. ex: the arrayList is ArrayList data=new…
Viswa A
  • 51
  • 1
  • 6
1
vote
1 answer

incompatible types: ArrayList?

I asked question here. Now I can pass arraylist to another activity. In my second activity, I am trying to post this arraylist. ArrayList testing =…
user8654574
  • 47
  • 1
  • 6
1
vote
1 answer

How to pass NameValuePair to another activity in android?

I have three activities in my application. A -> B -> C In Activity A: I am getting some data from user and add those data NameValuePair. I do some other operations in Activity B. After that in Activity C, I want to http post NameValuePair. However,…
user8654574
  • 47
  • 1
  • 6
1
vote
1 answer

How to set header in Android Json

I want to fetch data from the Web service HttpGet Method. Web Service needs two header information. How can i add set Parameters ? "Content-Type", "application/json" "Authorization", "Bearer " + Utils.PreferencesGetir(ActivityPuanlarim.this,…
1
vote
4 answers

creating complex JSON using BasicNameValuePair

How can I create this JSON using ArrayList for posting json in Android { "user" : { "nickname" : "nickname6", "password" : "1234", } } I get only to a flat JSON ArrayList nameValuePairs = new…
1
vote
0 answers

Unable to use NameValuePair in Android Studio

I want to upload data to a server from my android application.For this I want to use NameValuePair in my code ArrayList nameValuePairs = new ArrayList(); nameValuePairs.add(new…
user317461
  • 185
  • 1
  • 2
  • 8
1
vote
0 answers

Sending java.util.date / java.sql.date using BasicNameValuePairs in Android

I am currently working on an app that inserts some data into a database. I send this data using BasicNameValuePairs which I construct like this: nameValuePairs.add(new BasicNameValuePair("date", dateList.get(i).toString())); where dateList is an…
rikojir
  • 115
  • 2
  • 13
1
vote
1 answer

How to solve NameValuePair cannot be a String in Android

I'm learning how to build android Apps, and I'm trying to insert values into my Database using Java and PHP. But NameValuePair is giving me multiple errors. I already imported the necessary files. What am I doing wrong? My PHP file: $connect =…
0
votes
1 answer

parcelable class for nameValuePair?

I want to pass ArrayList nameValuePairs one activity to another. I wrote parcelable class for this. Parcelable Class: /**Getters/Setters have been removed to make reading easier*// public class BasicNameValuePair implements…
user8654574
  • 47
  • 1
  • 6
1
2 3